semevent-r0drv-solaris.c revision b79e4344bf4eb8033fd06d560cd864192728bd0b
0N/A * IPRT - Semaphores, Ring-0 Driver, Solaris. 0N/A * Copyright (C) 2006-2007 Sun Microsystems, Inc. 0N/A * This file is part of VirtualBox Open Source Edition (OSE), as 0N/A * you can redistribute it and/or modify it under the terms of the GNU 0N/A * General Public License (GPL) as published by the Free Software 0N/A * Foundation, in version 2 as it comes in the "COPYING" file of the 0N/A * VirtualBox OSE distribution. VirtualBox OSE is distributed in the 0N/A * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 0N/A * The contents of this file may alternatively be used under the terms 0N/A * of the Common Development and Distribution License Version 1.0 1472N/A * (CDDL) only, as it comes in the "COPYING.CDDL" file of the 1472N/A * VirtualBox OSE distribution, in which case the provisions of the 1472N/A * CDDL are applicable instead of those of the GPL. 0N/A * You may elect to license modified versions of this file under the 0N/A * terms and conditions of either the GPL or the CDDL or both. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa 0N/A * additional information or have any questions. 0N/A/******************************************************************************* 0N/A*******************************************************************************/ 0N/A/******************************************************************************* 0N/A* Structures and Typedefs * 0N/A*******************************************************************************/ 0N/A * Solaris event semaphore. 0N/A /** Magic value (RTSEMEVENT_MAGIC). */ 0N/A /** The number of waiting threads. */ 0N/A /** Set if the event object is signaled. */ 0N/A /** The number of threads in the process of waking up. */ /** The Solaris mutex protecting this structure and pairing up the with the cv. */ /** The Solaris condition variable. */ /* abort waiting thread, last man cleans up. */ /* the last waking thread is gonna do the cleanup */ * If we're in interrupt context we need to unpin the underlying current * thread as this could lead to a deadlock (see #4259 for the full explanation) * Note! This assumes nobody is using the RTThreadPreemptDisable in an * interrupt context and expects it to work right. The swtch will * result in a voluntary preemption. To fix this, we would have to * on systems which doesn't do preemption (OS/2, linux, ...) and * check whether preemption was disabled via RTThreadPreemptDisable * or not and only call swtch if RTThreadPreemptDisable wasn't called. * Translate milliseconds into ticks and go to sleep. /* Retured due to call to cv_signal() or cv_broadcast() */ /* Returned due to timeout being reached */ /* Returned due to pending signal */