semeventmulti-r0drv-darwin.cpp revision a8f65e585466d1267633cea76b4f97a69b7f1cc0
05afe08870681beb0792f384475077c988916762vboxsync/* $Id$ */
05afe08870681beb0792f384475077c988916762vboxsync/** @file
05afe08870681beb0792f384475077c988916762vboxsync * IPRT - Multiple Release Event Semaphores, Ring-0 Driver, Darwin.
05afe08870681beb0792f384475077c988916762vboxsync */
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync/*
e64031e20c39650a7bc902a3e1aba613b9415deevboxsync * Copyright (C) 2006-2010 Oracle Corporation
05afe08870681beb0792f384475077c988916762vboxsync *
05afe08870681beb0792f384475077c988916762vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
05afe08870681beb0792f384475077c988916762vboxsync * available from http://www.virtualbox.org. This file is free software;
05afe08870681beb0792f384475077c988916762vboxsync * you can redistribute it and/or modify it under the terms of the GNU
05afe08870681beb0792f384475077c988916762vboxsync * General Public License (GPL) as published by the Free Software
05afe08870681beb0792f384475077c988916762vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
05afe08870681beb0792f384475077c988916762vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
05afe08870681beb0792f384475077c988916762vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
05afe08870681beb0792f384475077c988916762vboxsync *
05afe08870681beb0792f384475077c988916762vboxsync * The contents of this file may alternatively be used under the terms
05afe08870681beb0792f384475077c988916762vboxsync * of the Common Development and Distribution License Version 1.0
05afe08870681beb0792f384475077c988916762vboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
05afe08870681beb0792f384475077c988916762vboxsync * VirtualBox OSE distribution, in which case the provisions of the
05afe08870681beb0792f384475077c988916762vboxsync * CDDL are applicable instead of those of the GPL.
05afe08870681beb0792f384475077c988916762vboxsync *
05afe08870681beb0792f384475077c988916762vboxsync * You may elect to license modified versions of this file under the
05afe08870681beb0792f384475077c988916762vboxsync * terms and conditions of either the GPL or the CDDL or both.
05afe08870681beb0792f384475077c988916762vboxsync */
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync/*******************************************************************************
05afe08870681beb0792f384475077c988916762vboxsync* Header Files *
05afe08870681beb0792f384475077c988916762vboxsync*******************************************************************************/
05afe08870681beb0792f384475077c988916762vboxsync#include "the-darwin-kernel.h"
05afe08870681beb0792f384475077c988916762vboxsync#include "internal/iprt.h"
05afe08870681beb0792f384475077c988916762vboxsync#include <iprt/semaphore.h>
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync#include <iprt/assert.h>
05afe08870681beb0792f384475077c988916762vboxsync#include <iprt/asm.h>
a8f65e585466d1267633cea76b4f97a69b7f1cc0vboxsync#if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)
a8f65e585466d1267633cea76b4f97a69b7f1cc0vboxsync# include <iprt/asm-amd64-x86.h>
a8f65e585466d1267633cea76b4f97a69b7f1cc0vboxsync#endif
05afe08870681beb0792f384475077c988916762vboxsync#include <iprt/err.h>
a8f65e585466d1267633cea76b4f97a69b7f1cc0vboxsync#include <iprt/mem.h>
05afe08870681beb0792f384475077c988916762vboxsync#include <iprt/mp.h>
05afe08870681beb0792f384475077c988916762vboxsync#include <iprt/thread.h>
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync#include "internal/magics.h"
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync/*******************************************************************************
05afe08870681beb0792f384475077c988916762vboxsync* Structures and Typedefs *
05afe08870681beb0792f384475077c988916762vboxsync*******************************************************************************/
05afe08870681beb0792f384475077c988916762vboxsync/**
05afe08870681beb0792f384475077c988916762vboxsync * Darwin multiple release event semaphore.
05afe08870681beb0792f384475077c988916762vboxsync */
05afe08870681beb0792f384475077c988916762vboxsynctypedef struct RTSEMEVENTMULTIINTERNAL
05afe08870681beb0792f384475077c988916762vboxsync{
05afe08870681beb0792f384475077c988916762vboxsync /** Magic value (RTSEMEVENTMULTI_MAGIC). */
05afe08870681beb0792f384475077c988916762vboxsync uint32_t volatile u32Magic;
05afe08870681beb0792f384475077c988916762vboxsync /** The number of waiting threads. */
05afe08870681beb0792f384475077c988916762vboxsync uint32_t volatile cWaiters;
05afe08870681beb0792f384475077c988916762vboxsync /** Set if the event object is signaled. */
05afe08870681beb0792f384475077c988916762vboxsync uint8_t volatile fSignaled;
05afe08870681beb0792f384475077c988916762vboxsync /** The number of threads in the process of waking up. */
05afe08870681beb0792f384475077c988916762vboxsync uint32_t volatile cWaking;
05afe08870681beb0792f384475077c988916762vboxsync /** The spinlock protecting us. */
05afe08870681beb0792f384475077c988916762vboxsync lck_spin_t *pSpinlock;
05afe08870681beb0792f384475077c988916762vboxsync} RTSEMEVENTMULTIINTERNAL, *PRTSEMEVENTMULTIINTERNAL;
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsyncRTDECL(int) RTSemEventMultiCreate(PRTSEMEVENTMULTI phEventMultiSem)
05afe08870681beb0792f384475077c988916762vboxsync{
05afe08870681beb0792f384475077c988916762vboxsync return RTSemEventMultiCreateEx(phEventMultiSem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, NULL);
05afe08870681beb0792f384475077c988916762vboxsync}
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsyncRTDECL(int) RTSemEventMultiCreateEx(PRTSEMEVENTMULTI phEventMultiSem, uint32_t fFlags, RTLOCKVALCLASS hClass,
05afe08870681beb0792f384475077c988916762vboxsync const char *pszNameFmt, ...)
05afe08870681beb0792f384475077c988916762vboxsync{
05afe08870681beb0792f384475077c988916762vboxsync AssertReturn(!(fFlags & ~RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER);
05afe08870681beb0792f384475077c988916762vboxsync AssertCompile(sizeof(RTSEMEVENTMULTIINTERNAL) > sizeof(void *));
05afe08870681beb0792f384475077c988916762vboxsync AssertPtrReturn(phEventMultiSem, VERR_INVALID_POINTER);
05afe08870681beb0792f384475077c988916762vboxsync RT_ASSERT_PREEMPTIBLE();
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)RTMemAlloc(sizeof(*pThis));
05afe08870681beb0792f384475077c988916762vboxsync if (pThis)
05afe08870681beb0792f384475077c988916762vboxsync {
05afe08870681beb0792f384475077c988916762vboxsync pThis->u32Magic = RTSEMEVENTMULTI_MAGIC;
05afe08870681beb0792f384475077c988916762vboxsync pThis->cWaiters = 0;
05afe08870681beb0792f384475077c988916762vboxsync pThis->cWaking = 0;
05afe08870681beb0792f384475077c988916762vboxsync pThis->fSignaled = 0;
05afe08870681beb0792f384475077c988916762vboxsync Assert(g_pDarwinLockGroup);
05afe08870681beb0792f384475077c988916762vboxsync pThis->pSpinlock = lck_spin_alloc_init(g_pDarwinLockGroup, LCK_ATTR_NULL);
05afe08870681beb0792f384475077c988916762vboxsync if (pThis->pSpinlock)
05afe08870681beb0792f384475077c988916762vboxsync {
05afe08870681beb0792f384475077c988916762vboxsync *phEventMultiSem = pThis;
05afe08870681beb0792f384475077c988916762vboxsync return VINF_SUCCESS;
05afe08870681beb0792f384475077c988916762vboxsync }
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync pThis->u32Magic = 0;
05afe08870681beb0792f384475077c988916762vboxsync RTMemFree(pThis);
05afe08870681beb0792f384475077c988916762vboxsync }
05afe08870681beb0792f384475077c988916762vboxsync return VERR_NO_MEMORY;
05afe08870681beb0792f384475077c988916762vboxsync}
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsyncRTDECL(int) RTSemEventMultiDestroy(RTSEMEVENTMULTI hEventMultiSem)
05afe08870681beb0792f384475077c988916762vboxsync{
05afe08870681beb0792f384475077c988916762vboxsync PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
05afe08870681beb0792f384475077c988916762vboxsync if (pThis == NIL_RTSEMEVENTMULTI)
05afe08870681beb0792f384475077c988916762vboxsync return VINF_SUCCESS;
05afe08870681beb0792f384475077c988916762vboxsync AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
05afe08870681beb0792f384475077c988916762vboxsync AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
05afe08870681beb0792f384475077c988916762vboxsync RT_ASSERT_INTS_ON();
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync lck_spin_lock(pThis->pSpinlock);
05afe08870681beb0792f384475077c988916762vboxsync ASMAtomicIncU32(&pThis->u32Magic); /* make the handle invalid */
05afe08870681beb0792f384475077c988916762vboxsync if (pThis->cWaiters > 0)
05afe08870681beb0792f384475077c988916762vboxsync {
05afe08870681beb0792f384475077c988916762vboxsync /* abort waiting thread, last man cleans up. */
05afe08870681beb0792f384475077c988916762vboxsync ASMAtomicXchgU32(&pThis->cWaking, pThis->cWaking + pThis->cWaiters);
05afe08870681beb0792f384475077c988916762vboxsync thread_wakeup_prim((event_t)pThis, FALSE /* all threads */, THREAD_RESTART);
05afe08870681beb0792f384475077c988916762vboxsync lck_spin_unlock(pThis->pSpinlock);
05afe08870681beb0792f384475077c988916762vboxsync }
05afe08870681beb0792f384475077c988916762vboxsync else if (pThis->cWaking)
05afe08870681beb0792f384475077c988916762vboxsync /* the last waking thread is gonna do the cleanup */
05afe08870681beb0792f384475077c988916762vboxsync lck_spin_unlock(pThis->pSpinlock);
05afe08870681beb0792f384475077c988916762vboxsync else
05afe08870681beb0792f384475077c988916762vboxsync {
05afe08870681beb0792f384475077c988916762vboxsync lck_spin_unlock(pThis->pSpinlock);
05afe08870681beb0792f384475077c988916762vboxsync lck_spin_destroy(pThis->pSpinlock, g_pDarwinLockGroup);
05afe08870681beb0792f384475077c988916762vboxsync RTMemFree(pThis);
05afe08870681beb0792f384475077c988916762vboxsync }
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync return VINF_SUCCESS;
05afe08870681beb0792f384475077c988916762vboxsync}
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsyncRTDECL(int) RTSemEventMultiSignal(RTSEMEVENTMULTI hEventMultiSem)
05afe08870681beb0792f384475077c988916762vboxsync{
05afe08870681beb0792f384475077c988916762vboxsync PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
05afe08870681beb0792f384475077c988916762vboxsync AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
05afe08870681beb0792f384475077c988916762vboxsync AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
05afe08870681beb0792f384475077c988916762vboxsync RT_ASSERT_PREEMPT_CPUID_VAR();
05afe08870681beb0792f384475077c988916762vboxsync RT_ASSERT_INTS_ON();
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync lck_spin_lock(pThis->pSpinlock);
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync ASMAtomicXchgU8(&pThis->fSignaled, true);
05afe08870681beb0792f384475077c988916762vboxsync if (pThis->cWaiters > 0)
05afe08870681beb0792f384475077c988916762vboxsync {
05afe08870681beb0792f384475077c988916762vboxsync ASMAtomicXchgU32(&pThis->cWaking, pThis->cWaking + pThis->cWaiters);
05afe08870681beb0792f384475077c988916762vboxsync ASMAtomicXchgU32(&pThis->cWaiters, 0);
05afe08870681beb0792f384475077c988916762vboxsync thread_wakeup_prim((event_t)pThis, FALSE /* all threads */, THREAD_AWAKENED);
05afe08870681beb0792f384475077c988916762vboxsync }
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync lck_spin_unlock(pThis->pSpinlock);
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync RT_ASSERT_PREEMPT_CPUID();
05afe08870681beb0792f384475077c988916762vboxsync return VINF_SUCCESS;
05afe08870681beb0792f384475077c988916762vboxsync}
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsyncRTDECL(int) RTSemEventMultiReset(RTSEMEVENTMULTI hEventMultiSem)
05afe08870681beb0792f384475077c988916762vboxsync{
05afe08870681beb0792f384475077c988916762vboxsync PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
05afe08870681beb0792f384475077c988916762vboxsync AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
05afe08870681beb0792f384475077c988916762vboxsync AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
05afe08870681beb0792f384475077c988916762vboxsync RT_ASSERT_PREEMPT_CPUID_VAR();
05afe08870681beb0792f384475077c988916762vboxsync RT_ASSERT_INTS_ON();
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync lck_spin_lock(pThis->pSpinlock);
05afe08870681beb0792f384475077c988916762vboxsync ASMAtomicXchgU8(&pThis->fSignaled, false);
05afe08870681beb0792f384475077c988916762vboxsync lck_spin_unlock(pThis->pSpinlock);
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync RT_ASSERT_PREEMPT_CPUID();
05afe08870681beb0792f384475077c988916762vboxsync return VINF_SUCCESS;
05afe08870681beb0792f384475077c988916762vboxsync}
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsyncstatic int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies, wait_interrupt_t fInterruptible)
05afe08870681beb0792f384475077c988916762vboxsync{
05afe08870681beb0792f384475077c988916762vboxsync PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
05afe08870681beb0792f384475077c988916762vboxsync AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
05afe08870681beb0792f384475077c988916762vboxsync AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
05afe08870681beb0792f384475077c988916762vboxsync if (cMillies)
05afe08870681beb0792f384475077c988916762vboxsync RT_ASSERT_PREEMPTIBLE();
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync lck_spin_lock(pThis->pSpinlock);
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync int rc;
05afe08870681beb0792f384475077c988916762vboxsync if (pThis->fSignaled)
05afe08870681beb0792f384475077c988916762vboxsync rc = VINF_SUCCESS;
05afe08870681beb0792f384475077c988916762vboxsync else if (!cMillies)
05afe08870681beb0792f384475077c988916762vboxsync rc = VERR_TIMEOUT;
05afe08870681beb0792f384475077c988916762vboxsync else
05afe08870681beb0792f384475077c988916762vboxsync {
05afe08870681beb0792f384475077c988916762vboxsync ASMAtomicIncU32(&pThis->cWaiters);
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync wait_result_t rcWait;
05afe08870681beb0792f384475077c988916762vboxsync if (cMillies == RT_INDEFINITE_WAIT)
05afe08870681beb0792f384475077c988916762vboxsync rcWait = lck_spin_sleep(pThis->pSpinlock, LCK_SLEEP_DEFAULT, (event_t)pThis, fInterruptible);
05afe08870681beb0792f384475077c988916762vboxsync else
05afe08870681beb0792f384475077c988916762vboxsync {
05afe08870681beb0792f384475077c988916762vboxsync uint64_t u64AbsTime;
05afe08870681beb0792f384475077c988916762vboxsync nanoseconds_to_absolutetime(cMillies * UINT64_C(1000000), &u64AbsTime);
05afe08870681beb0792f384475077c988916762vboxsync u64AbsTime += mach_absolute_time();
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync rcWait = lck_spin_sleep_deadline(pThis->pSpinlock, LCK_SLEEP_DEFAULT,
05afe08870681beb0792f384475077c988916762vboxsync (event_t)pThis, fInterruptible, u64AbsTime);
05afe08870681beb0792f384475077c988916762vboxsync }
05afe08870681beb0792f384475077c988916762vboxsync switch (rcWait)
05afe08870681beb0792f384475077c988916762vboxsync {
05afe08870681beb0792f384475077c988916762vboxsync case THREAD_AWAKENED:
05afe08870681beb0792f384475077c988916762vboxsync Assert(pThis->cWaking > 0);
05afe08870681beb0792f384475077c988916762vboxsync if ( !ASMAtomicDecU32(&pThis->cWaking)
05afe08870681beb0792f384475077c988916762vboxsync && pThis->u32Magic != RTSEMEVENTMULTI_MAGIC)
05afe08870681beb0792f384475077c988916762vboxsync {
05afe08870681beb0792f384475077c988916762vboxsync /* the event was destroyed after we woke up, as the last thread do the cleanup. */
05afe08870681beb0792f384475077c988916762vboxsync lck_spin_unlock(pThis->pSpinlock);
05afe08870681beb0792f384475077c988916762vboxsync Assert(g_pDarwinLockGroup);
05afe08870681beb0792f384475077c988916762vboxsync lck_spin_destroy(pThis->pSpinlock, g_pDarwinLockGroup);
05afe08870681beb0792f384475077c988916762vboxsync RTMemFree(pThis);
05afe08870681beb0792f384475077c988916762vboxsync return VINF_SUCCESS;
05afe08870681beb0792f384475077c988916762vboxsync }
05afe08870681beb0792f384475077c988916762vboxsync rc = VINF_SUCCESS;
05afe08870681beb0792f384475077c988916762vboxsync break;
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync case THREAD_TIMED_OUT:
05afe08870681beb0792f384475077c988916762vboxsync Assert(cMillies != RT_INDEFINITE_WAIT);
05afe08870681beb0792f384475077c988916762vboxsync ASMAtomicDecU32(&pThis->cWaiters);
05afe08870681beb0792f384475077c988916762vboxsync rc = VERR_TIMEOUT;
05afe08870681beb0792f384475077c988916762vboxsync break;
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync case THREAD_INTERRUPTED:
05afe08870681beb0792f384475077c988916762vboxsync Assert(fInterruptible);
05afe08870681beb0792f384475077c988916762vboxsync ASMAtomicDecU32(&pThis->cWaiters);
05afe08870681beb0792f384475077c988916762vboxsync rc = VERR_INTERRUPTED;
05afe08870681beb0792f384475077c988916762vboxsync break;
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync case THREAD_RESTART:
05afe08870681beb0792f384475077c988916762vboxsync /* Last one out does the cleanup. */
05afe08870681beb0792f384475077c988916762vboxsync if (!ASMAtomicDecU32(&pThis->cWaking))
05afe08870681beb0792f384475077c988916762vboxsync {
05afe08870681beb0792f384475077c988916762vboxsync lck_spin_unlock(pThis->pSpinlock);
05afe08870681beb0792f384475077c988916762vboxsync Assert(g_pDarwinLockGroup);
05afe08870681beb0792f384475077c988916762vboxsync lck_spin_destroy(pThis->pSpinlock, g_pDarwinLockGroup);
05afe08870681beb0792f384475077c988916762vboxsync RTMemFree(pThis);
05afe08870681beb0792f384475077c988916762vboxsync return VERR_SEM_DESTROYED;
05afe08870681beb0792f384475077c988916762vboxsync }
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync rc = VERR_SEM_DESTROYED;
05afe08870681beb0792f384475077c988916762vboxsync break;
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync default:
05afe08870681beb0792f384475077c988916762vboxsync AssertMsgFailed(("rcWait=%d\n", rcWait));
05afe08870681beb0792f384475077c988916762vboxsync rc = VERR_GENERAL_FAILURE;
05afe08870681beb0792f384475077c988916762vboxsync break;
05afe08870681beb0792f384475077c988916762vboxsync }
05afe08870681beb0792f384475077c988916762vboxsync }
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync lck_spin_unlock(pThis->pSpinlock);
05afe08870681beb0792f384475077c988916762vboxsync return rc;
05afe08870681beb0792f384475077c988916762vboxsync}
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsyncRTDECL(int) RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
05afe08870681beb0792f384475077c988916762vboxsync{
05afe08870681beb0792f384475077c988916762vboxsync return rtSemEventMultiWait(hEventMultiSem, cMillies, THREAD_UNINT);
05afe08870681beb0792f384475077c988916762vboxsync}
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsync
05afe08870681beb0792f384475077c988916762vboxsyncRTDECL(int) RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, RTMSINTERVAL cMillies)
05afe08870681beb0792f384475077c988916762vboxsync{
05afe08870681beb0792f384475077c988916762vboxsync return rtSemEventMultiWait(hEventMultiSem, cMillies, THREAD_ABORTSAFE);
05afe08870681beb0792f384475077c988916762vboxsync}
05afe08870681beb0792f384475077c988916762vboxsync