Index: /trunk/include/iprt/semaphore.h
===================================================================
--- /trunk/include/iprt/semaphore.h	(revision 25719)
+++ /trunk/include/iprt/semaphore.h	(revision 25720)
@@ -59,5 +59,5 @@
 
 /**
- * Create a event semaphore.
+ * Create an event semaphore.
  *
  * @returns iprt status code.
@@ -68,5 +68,5 @@
 
 /**
- * Creates a read/write semaphore.
+ * Create an event semaphore.
  *
  * @returns iprt status code.
@@ -91,5 +91,4 @@
 /** @} */
 
-
 /**
  * Destroy an event semaphore.
@@ -183,10 +182,36 @@
 
 /**
- * Create a event multi semaphore.
- *
- * @returns iprt status code.
- * @param   pEventMultiSem  Where to store the event multi semaphore handle.
- */
-RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI pEventMultiSem);
+ * Creates a multiple release event semaphore.
+ *
+ * @returns iprt status code.
+ * @param   phEventMultiSem     Where to store the handle to the newly created
+ *                              multiple release event semaphore.
+ */
+RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI phEventMultiSem);
+
+/**
+ * Creates a multiple release event semaphore.
+ *
+ * @returns iprt status code.
+ * @param   phEventMultiSem     Where to store the handle to the newly created
+ *                              multiple release event semaphore.
+ * @param   fFlags              Flags, any combination of the
+ *                              RTSEMEVENTMULTI_FLAGS_XXX \#defines.
+ * @param   hClass              The class (no reference consumed).  Since we
+ *                              don't do order checks on event semaphores, the
+ *                              use of the class is limited to controlling the
+ *                              timeout threshold for deadlock detection.
+ * @param   pszNameFmt          Name format string for the lock validator,
+ *                              optional (NULL).  Max length is 32 bytes.
+ * @param   ...                 Format string arguments.
+ */
+RTDECL(int)  RTSemEventMultiCreateEx(PRTSEMEVENTMULTI phEventMultiSem, uint32_t fFlags, RTLOCKVALCLASS hClass,
+                                     const char *pszNameFmt, ...);
+
+/** @name RTSemMutexCreateEx flags
+ * @{ */
+/** Disables lock validation. */
+#define RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL   UINT32_C(0x00000001)
+/** @} */
 
 /**
@@ -194,7 +219,8 @@
  *
  * @returns iprt status code.
- * @param   EventMultiSem   The event multi sempahore to destroy.
- */
-RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI EventMultiSem);
+ * @param   hEventMultiSem      The multiple release event sempahore.  NIL is
+ *                              quietly ignored (VINF_SUCCESS).
+ */
+RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI hEventMultiSem);
 
 /**
@@ -202,7 +228,7 @@
  *
  * @returns iprt status code.
- * @param   EventMultiSem   The event multi semaphore to signal.
- */
-RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI EventMultiSem);
+ * @param   hEventMultiSem      The multiple release event sempahore.
+ */
+RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI hEventMultiSem);
 
 /**
@@ -210,7 +236,7 @@
  *
  * @returns iprt status code.
- * @param   EventMultiSem   The event multi semaphore to reset.
- */
-RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI EventMultiSem);
+ * @param   hEventMultiSem      The multiple release event sempahore.
+ */
+RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI hEventMultiSem);
 
 /**
@@ -222,8 +248,8 @@
  * @returns iprt status code.
  *          Will not return VERR_INTERRUPTED.
- * @param   EventMultiSem   The event multi semaphore to wait on.
- * @param   cMillies        Number of milliseconds to wait.
- */
-RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies);
+ * @param   hEventMultiSem      The multiple release event sempahore.
+ * @param   cMillies            Number of milliseconds to wait.
+ */
+RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies);
 
 
@@ -234,8 +260,8 @@
  *
  * @returns iprt status code.
- * @param   EventMultiSem   The event multi semaphore to wait on.
- * @param   cMillies        Number of milliseconds to wait.
- */
-RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies);
+ * @param   hEventMultiSem      The multiple release event sempahore.
+ * @param   cMillies            Number of milliseconds to wait.
+ */
+RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies);
 
 /**
Index: /trunk/src/VBox/Runtime/r0drv/darwin/semaphore-r0drv-darwin.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r0drv/darwin/semaphore-r0drv-darwin.cpp	(revision 25719)
+++ /trunk/src/VBox/Runtime/r0drv/darwin/semaphore-r0drv-darwin.cpp	(revision 25720)
@@ -219,7 +219,5 @@
     PRTSEMEVENTINTERNAL pThis = (PRTSEMEVENTINTERNAL)hEventSem;
     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
-    AssertMsgReturn(pThis->u32Magic == RTSEMEVENT_MAGIC,
-                    ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
-                    VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->u32Magic == RTSEMEVENT_MAGIC, ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
     if (cMillies)
         RT_ASSERT_PREEMPTIBLE();
@@ -320,27 +318,35 @@
 
 
-RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI pEventMultiSem)
-{
-    Assert(sizeof(RTSEMEVENTMULTIINTERNAL) > sizeof(void *));
-    AssertPtrReturn(pEventMultiSem, VERR_INVALID_POINTER);
+RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI phEventMultiSem)
+{
+    return RTSemEventMultiCreateEx(phEventMultiSem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, NULL);
+}
+
+
+RTDECL(int)  RTSemEventMultiCreateEx(PRTSEMEVENTMULTI phEventMultiSem, uint32_t fFlags, RTLOCKVALCLASS hClass,
+                                     const char *pszNameFmt, ...)
+{
+    AssertReturn(!(fFlags & ~RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER);
+    AssertCompile(sizeof(RTSEMEVENTMULTIINTERNAL) > sizeof(void *));
+    AssertPtrReturn(phEventMultiSem, VERR_INVALID_POINTER);
     RT_ASSERT_PREEMPTIBLE();
 
-    PRTSEMEVENTMULTIINTERNAL pEventMultiInt = (PRTSEMEVENTMULTIINTERNAL)RTMemAlloc(sizeof(*pEventMultiInt));
-    if (pEventMultiInt)
-    {
-        pEventMultiInt->u32Magic = RTSEMEVENTMULTI_MAGIC;
-        pEventMultiInt->cWaiters = 0;
-        pEventMultiInt->cWaking = 0;
-        pEventMultiInt->fSignaled = 0;
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)RTMemAlloc(sizeof(*pThis));
+    if (pThis)
+    {
+        pThis->u32Magic = RTSEMEVENTMULTI_MAGIC;
+        pThis->cWaiters = 0;
+        pThis->cWaking = 0;
+        pThis->fSignaled = 0;
         Assert(g_pDarwinLockGroup);
-        pEventMultiInt->pSpinlock = lck_spin_alloc_init(g_pDarwinLockGroup, LCK_ATTR_NULL);
-        if (pEventMultiInt->pSpinlock)
+        pThis->pSpinlock = lck_spin_alloc_init(g_pDarwinLockGroup, LCK_ATTR_NULL);
+        if (pThis->pSpinlock)
         {
-            *pEventMultiSem = pEventMultiInt;
+            *phEventMultiSem = pThis;
             return VINF_SUCCESS;
         }
 
-        pEventMultiInt->u32Magic = 0;
-        RTMemFree(pEventMultiInt);
+        pThis->u32Magic = 0;
+        RTMemFree(pThis);
     }
     return VERR_NO_MEMORY;
@@ -348,59 +354,55 @@
 
 
-RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI EventMultiSem)
-{
-    if (EventMultiSem == NIL_RTSEMEVENTMULTI)     /* don't bitch */
-        return VERR_INVALID_HANDLE;
-    PRTSEMEVENTMULTIINTERNAL pEventMultiInt = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
-    AssertPtrReturn(pEventMultiInt, VERR_INVALID_HANDLE);
-    AssertMsgReturn(pEventMultiInt->u32Magic == RTSEMEVENTMULTI_MAGIC,
-                    ("pEventMultiInt=%p u32Magic=%#x\n", pEventMultiInt, pEventMultiInt->u32Magic),
-                    VERR_INVALID_HANDLE);
+RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI hEventMultiSem)
+{
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
+    if (pThis == NIL_RTSEMEVENTMULTI)
+        return VINF_SUCCESS;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
     RT_ASSERT_INTS_ON();
 
-    lck_spin_lock(pEventMultiInt->pSpinlock);
-    ASMAtomicIncU32(&pEventMultiInt->u32Magic); /* make the handle invalid */
-    if (pEventMultiInt->cWaiters > 0)
+    lck_spin_lock(pThis->pSpinlock);
+    ASMAtomicIncU32(&pThis->u32Magic); /* make the handle invalid */
+    if (pThis->cWaiters > 0)
     {
         /* abort waiting thread, last man cleans up. */
-        ASMAtomicXchgU32(&pEventMultiInt->cWaking, pEventMultiInt->cWaking + pEventMultiInt->cWaiters);
-        thread_wakeup_prim((event_t)pEventMultiInt, FALSE /* all threads */, THREAD_RESTART);
-        lck_spin_unlock(pEventMultiInt->pSpinlock);
-    }
-    else if (pEventMultiInt->cWaking)
+        ASMAtomicXchgU32(&pThis->cWaking, pThis->cWaking + pThis->cWaiters);
+        thread_wakeup_prim((event_t)pThis, FALSE /* all threads */, THREAD_RESTART);
+        lck_spin_unlock(pThis->pSpinlock);
+    }
+    else if (pThis->cWaking)
         /* the last waking thread is gonna do the cleanup */
-        lck_spin_unlock(pEventMultiInt->pSpinlock);
+        lck_spin_unlock(pThis->pSpinlock);
     else
     {
-        lck_spin_unlock(pEventMultiInt->pSpinlock);
-        lck_spin_destroy(pEventMultiInt->pSpinlock, g_pDarwinLockGroup);
-        RTMemFree(pEventMultiInt);
-    }
-
-    return VINF_SUCCESS;
-}
-
-
-RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI EventMultiSem)
-{
-    PRTSEMEVENTMULTIINTERNAL pEventMultiInt = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
-    AssertPtrReturn(pEventMultiInt, VERR_INVALID_HANDLE);
-    AssertMsgReturn(pEventMultiInt->u32Magic == RTSEMEVENTMULTI_MAGIC,
-                    ("pEventMultiInt=%p u32Magic=%#x\n", pEventMultiInt, pEventMultiInt->u32Magic),
-                    VERR_INVALID_HANDLE);
+        lck_spin_unlock(pThis->pSpinlock);
+        lck_spin_destroy(pThis->pSpinlock, g_pDarwinLockGroup);
+        RTMemFree(pThis);
+    }
+
+    return VINF_SUCCESS;
+}
+
+
+RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI hEventMultiSem)
+{
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
     RT_ASSERT_PREEMPT_CPUID_VAR();
     RT_ASSERT_INTS_ON();
 
-    lck_spin_lock(pEventMultiInt->pSpinlock);
-
-    ASMAtomicXchgU8(&pEventMultiInt->fSignaled, true);
-    if (pEventMultiInt->cWaiters > 0)
-    {
-        ASMAtomicXchgU32(&pEventMultiInt->cWaking, pEventMultiInt->cWaking + pEventMultiInt->cWaiters);
-        ASMAtomicXchgU32(&pEventMultiInt->cWaiters, 0);
-        thread_wakeup_prim((event_t)pEventMultiInt, FALSE /* all threads */, THREAD_AWAKENED);
-    }
-
-    lck_spin_unlock(pEventMultiInt->pSpinlock);
+    lck_spin_lock(pThis->pSpinlock);
+
+    ASMAtomicXchgU8(&pThis->fSignaled, true);
+    if (pThis->cWaiters > 0)
+    {
+        ASMAtomicXchgU32(&pThis->cWaking, pThis->cWaking + pThis->cWaiters);
+        ASMAtomicXchgU32(&pThis->cWaiters, 0);
+        thread_wakeup_prim((event_t)pThis, FALSE /* all threads */, THREAD_AWAKENED);
+    }
+
+    lck_spin_unlock(pThis->pSpinlock);
 
     RT_ASSERT_PREEMPT_CPUID();
@@ -409,17 +411,15 @@
 
 
-RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI EventMultiSem)
-{
-    PRTSEMEVENTMULTIINTERNAL pEventMultiInt = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
-    AssertPtrReturn(pEventMultiInt, VERR_INVALID_HANDLE);
-    AssertMsgReturn(pEventMultiInt->u32Magic == RTSEMEVENTMULTI_MAGIC,
-                    ("pEventMultiInt=%p u32Magic=%#x\n", pEventMultiInt, pEventMultiInt->u32Magic),
-                    VERR_INVALID_HANDLE);
+RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI hEventMultiSem)
+{
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
     RT_ASSERT_PREEMPT_CPUID_VAR();
     RT_ASSERT_INTS_ON();
 
-    lck_spin_lock(pEventMultiInt->pSpinlock);
-    ASMAtomicXchgU8(&pEventMultiInt->fSignaled, false);
-    lck_spin_unlock(pEventMultiInt->pSpinlock);
+    lck_spin_lock(pThis->pSpinlock);
+    ASMAtomicXchgU8(&pThis->fSignaled, false);
+    lck_spin_unlock(pThis->pSpinlock);
 
     RT_ASSERT_PREEMPT_CPUID();
@@ -428,18 +428,16 @@
 
 
-static int rtSemEventMultiWait(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies, wait_interrupt_t fInterruptible)
-{
-    PRTSEMEVENTMULTIINTERNAL pEventMultiInt = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
-    AssertPtrReturn(pEventMultiInt, VERR_INVALID_HANDLE);
-    AssertMsgReturn(pEventMultiInt->u32Magic == RTSEMEVENTMULTI_MAGIC,
-                    ("pEventMultiInt=%p u32Magic=%#x\n", pEventMultiInt, pEventMultiInt->u32Magic),
-                    VERR_INVALID_HANDLE);
+static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies, wait_interrupt_t fInterruptible)
+{
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
     if (cMillies)
         RT_ASSERT_PREEMPTIBLE();
 
-    lck_spin_lock(pEventMultiInt->pSpinlock);
+    lck_spin_lock(pThis->pSpinlock);
 
     int rc;
-    if (pEventMultiInt->fSignaled)
+    if (pThis->fSignaled)
         rc = VINF_SUCCESS;
     else if (!cMillies)
@@ -447,9 +445,9 @@
     else
     {
-        ASMAtomicIncU32(&pEventMultiInt->cWaiters);
+        ASMAtomicIncU32(&pThis->cWaiters);
 
         wait_result_t rcWait;
         if (cMillies == RT_INDEFINITE_WAIT)
-            rcWait = lck_spin_sleep(pEventMultiInt->pSpinlock, LCK_SLEEP_DEFAULT, (event_t)pEventMultiInt, fInterruptible);
+            rcWait = lck_spin_sleep(pThis->pSpinlock, LCK_SLEEP_DEFAULT, (event_t)pThis, fInterruptible);
         else
         {
@@ -458,19 +456,19 @@
             u64AbsTime += mach_absolute_time();
 
-            rcWait = lck_spin_sleep_deadline(pEventMultiInt->pSpinlock, LCK_SLEEP_DEFAULT,
-                                             (event_t)pEventMultiInt, fInterruptible, u64AbsTime);
+            rcWait = lck_spin_sleep_deadline(pThis->pSpinlock, LCK_SLEEP_DEFAULT,
+                                             (event_t)pThis, fInterruptible, u64AbsTime);
         }
         switch (rcWait)
         {
             case THREAD_AWAKENED:
-                Assert(pEventMultiInt->cWaking > 0);
-                if (    !ASMAtomicDecU32(&pEventMultiInt->cWaking)
-                    &&  pEventMultiInt->u32Magic != RTSEMEVENTMULTI_MAGIC)
+                Assert(pThis->cWaking > 0);
+                if (    !ASMAtomicDecU32(&pThis->cWaking)
+                    &&  pThis->u32Magic != RTSEMEVENTMULTI_MAGIC)
                 {
                     /* the event was destroyed after we woke up, as the last thread do the cleanup. */
-                    lck_spin_unlock(pEventMultiInt->pSpinlock);
+                    lck_spin_unlock(pThis->pSpinlock);
                     Assert(g_pDarwinLockGroup);
-                    lck_spin_destroy(pEventMultiInt->pSpinlock, g_pDarwinLockGroup);
-                    RTMemFree(pEventMultiInt);
+                    lck_spin_destroy(pThis->pSpinlock, g_pDarwinLockGroup);
+                    RTMemFree(pThis);
                     return VINF_SUCCESS;
                 }
@@ -480,5 +478,5 @@
             case THREAD_TIMED_OUT:
                 Assert(cMillies != RT_INDEFINITE_WAIT);
-                ASMAtomicDecU32(&pEventMultiInt->cWaiters);
+                ASMAtomicDecU32(&pThis->cWaiters);
                 rc = VERR_TIMEOUT;
                 break;
@@ -486,5 +484,5 @@
             case THREAD_INTERRUPTED:
                 Assert(fInterruptible);
-                ASMAtomicDecU32(&pEventMultiInt->cWaiters);
+                ASMAtomicDecU32(&pThis->cWaiters);
                 rc = VERR_INTERRUPTED;
                 break;
@@ -492,10 +490,10 @@
             case THREAD_RESTART:
                 /* Last one out does the cleanup. */
-                if (!ASMAtomicDecU32(&pEventMultiInt->cWaking))
+                if (!ASMAtomicDecU32(&pThis->cWaking))
                 {
-                    lck_spin_unlock(pEventMultiInt->pSpinlock);
+                    lck_spin_unlock(pThis->pSpinlock);
                     Assert(g_pDarwinLockGroup);
-                    lck_spin_destroy(pEventMultiInt->pSpinlock, g_pDarwinLockGroup);
-                    RTMemFree(pEventMultiInt);
+                    lck_spin_destroy(pThis->pSpinlock, g_pDarwinLockGroup);
+                    RTMemFree(pThis);
                     return VERR_SEM_DESTROYED;
                 }
@@ -511,18 +509,18 @@
     }
 
-    lck_spin_unlock(pEventMultiInt->pSpinlock);
+    lck_spin_unlock(pThis->pSpinlock);
     return rc;
 }
 
 
-RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
-{
-    return rtSemEventMultiWait(EventMultiSem, cMillies, THREAD_UNINT);
-}
-
-
-RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
-{
-    return rtSemEventMultiWait(EventMultiSem, cMillies, THREAD_ABORTSAFE);
+RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
+{
+    return rtSemEventMultiWait(hEventMultiSem, cMillies, THREAD_UNINT);
+}
+
+
+RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
+{
+    return rtSemEventMultiWait(hEventMultiSem, cMillies, THREAD_ABORTSAFE);
 }
 
@@ -536,16 +534,16 @@
     RT_ASSERT_PREEMPTIBLE();
     AssertCompile(sizeof(RTSEMMUTEXINTERNAL) > sizeof(void *));
-    PRTSEMMUTEXINTERNAL pMutexInt = (PRTSEMMUTEXINTERNAL)RTMemAlloc(sizeof(*pMutexInt));
-    if (pMutexInt)
-    {
-        pMutexInt->u32Magic = RTSEMMUTEX_MAGIC;
+    PRTSEMMUTEXINTERNAL pThis = (PRTSEMMUTEXINTERNAL)RTMemAlloc(sizeof(*pThis));
+    if (pThis)
+    {
+        pThis->u32Magic = RTSEMMUTEX_MAGIC;
         Assert(g_pDarwinLockGroup);
-        pMutexInt->pMtx = lck_mtx_alloc_init(g_pDarwinLockGroup, LCK_ATTR_NULL);
-        if (pMutexInt->pMtx)
+        pThis->pMtx = lck_mtx_alloc_init(g_pDarwinLockGroup, LCK_ATTR_NULL);
+        if (pThis->pMtx)
         {
-            *pMutexSem = pMutexInt;
+            *pMutexSem = pThis;
             return VINF_SUCCESS;
         }
-        RTMemFree(pMutexInt);
+        RTMemFree(pThis);
     }
     return VERR_NO_MEMORY;
@@ -558,11 +556,9 @@
      * Validate input.
      */
-    PRTSEMMUTEXINTERNAL pMutexInt = (PRTSEMMUTEXINTERNAL)MutexSem;
-    if (!pMutexInt)
+    PRTSEMMUTEXINTERNAL pThis = (PRTSEMMUTEXINTERNAL)MutexSem;
+    if (!pThis)
         return VERR_INVALID_PARAMETER;
-    AssertPtrReturn(pMutexInt, VERR_INVALID_POINTER);
-    AssertMsg(pMutexInt->u32Magic == RTSEMMUTEX_MAGIC,
-              ("pMutexInt->u32Magic=%RX32 pMutexInt=%p\n", pMutexInt->u32Magic, pMutexInt)
-              VERR_INVALID_PARAMETER);
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsg(pThis->u32Magic == RTSEMMUTEX_MAGIC, ("u32Magic=%RX32 pThis=%p\n", pThis->u32Magic, pThis), VERR_INVALID_HANDLE);
     RT_ASSERT_INTS_ON();
 
@@ -570,11 +566,11 @@
      * Invalidate it and signal the object just in case.
      */
-    ASMAtomicIncU32(&pMutexInt->u32Magic);
+    ASMAtomicIncU32(&pThis->u32Magic);
 
     Assert(g_pDarwinLockGroup);
-    lck_mtx_free(pMutexInt->pMtx, g_pDarwinLockGroup);
-    pMutexInt->pMtx = NULL;
-
-    RTMemFree(pMutexInt);
+    lck_mtx_free(pThis->pMtx, g_pDarwinLockGroup);
+    pThis->pMtx = NULL;
+
+    RTMemFree(pThis);
     return VINF_SUCCESS;
 }
@@ -586,11 +582,9 @@
      * Validate input.
      */
-    PRTSEMMUTEXINTERNAL pMutexInt = (PRTSEMMUTEXINTERNAL)MutexSem;
-    if (!pMutexInt)
+    PRTSEMMUTEXINTERNAL pThis = (PRTSEMMUTEXINTERNAL)MutexSem;
+    if (!pThis)
         return VERR_INVALID_PARAMETER;
-    AssertPtrReturn(pMutexInt, VERR_INVALID_POINTER);
-    AssertMsg(pMutexInt->u32Magic == RTSEMMUTEX_MAGIC,
-              ("pMutexInt->u32Magic=%RX32 pMutexInt=%p\n", pMutexInt->u32Magic, pMutexInt)
-              VERR_INVALID_PARAMETER);
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsg(pThis->u32Magic == RTSEMMUTEX_MAGIC, ("u32Magic=%RX32 pThis=%p\n", pThis->u32Magic, pThis), VERR_INVALID_HANDLE);
     if (cMillies)
         RT_ASSERT_PREEMPTIBLE();
@@ -604,15 +598,15 @@
     NTSTATUS rcNt;
     if (cMillies == RT_INDEFINITE_WAIT)
-        rcNt = KeWaitForSingleObject(&pMutexInt->Mutex, Executive, KernelMode, TRUE, NULL);
+        rcNt = KeWaitForSingleObject(&pThis->Mutex, Executive, KernelMode, TRUE, NULL);
     else
     {
         LARGE_INTEGER Timeout;
         Timeout.QuadPart = -(int64_t)cMillies * 10000;
-        rcNt = KeWaitForSingleObject(&pMutexInt->Mutex, Executive, KernelMode, TRUE, &Timeout);
+        rcNt = KeWaitForSingleObject(&pThis->Mutex, Executive, KernelMode, TRUE, &Timeout);
     }
     switch (rcNt)
     {
         case STATUS_SUCCESS:
-            if (pMutexInt->u32Magic == RTSEMMUTEX_MAGIC)
+            if (pThis->u32Magic == RTSEMMUTEX_MAGIC)
                 return VINF_SUCCESS;
             return VERR_SEM_DESTROYED;
@@ -624,6 +618,6 @@
             return VERR_TIMEOUT;
         default:
-            AssertMsgFailed(("pMutexInt->u32Magic=%RX32 pMutexInt=%p: wait returned %lx!\n",
-                             pMutexInt->u32Magic, pMutexInt, (long)rcNt));
+            AssertMsgFailed(("pThis->u32Magic=%RX32 pThis=%p: wait returned %lx!\n",
+                             pThis->u32Magic, pThis, (long)rcNt));
             return VERR_INTERNAL_ERROR;
     }
@@ -638,13 +632,7 @@
      * Validate input.
      */
-    PRTSEMMUTEXINTERNAL pMutexInt = (PRTSEMMUTEXINTERNAL)MutexSem;
-    if (!pMutexInt)
-        return VERR_INVALID_PARAMETER;
-    if (    !pMutexInt
-        ||  pMutexInt->u32Magic != RTSEMMUTEX_MAGIC)
-    {
-        AssertMsgFailed(("pMutexInt->u32Magic=%RX32 pMutexInt=%p\n", pMutexInt ? pMutexInt->u32Magic : 0, pMutexInt));
-        return VERR_INVALID_PARAMETER;
-    }
+    PRTSEMMUTEXINTERNAL pThis = (PRTSEMMUTEXINTERNAL)MutexSem;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsg(pThis->u32Magic == RTSEMMUTEX_MAGIC, ("u32Magic=%RX32 pThis=%p\n", pThis->u32Magic, pThis), VERR_INVALID_HANDLE);
     RT_ASSERT_PREEMPTIBLE();
 
@@ -653,7 +641,7 @@
      */
 #ifdef RT_USE_FAST_MUTEX
-    ExReleaseFastMutex(&pMutexInt->Mutex);
+    ExReleaseFastMutex(&pThis->Mutex);
 #else
-    KeReleaseMutex(&pMutexInt->Mutex, FALSE);
+    KeReleaseMutex(&pThis->Mutex, FALSE);
 #endif
     return VINF_SUCCESS;
Index: /trunk/src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c
===================================================================
--- /trunk/src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c	(revision 25719)
+++ /trunk/src/VBox/Runtime/r0drv/freebsd/semeventmulti-r0drv-freebsd.c	(revision 25720)
@@ -64,24 +64,32 @@
 
 
-RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI pEventMultiSem)
-{
-    Assert(sizeof(RTSEMEVENTMULTIINTERNAL) > sizeof(void *));
-    AssertPtrReturn(pEventMultiSem, VERR_INVALID_POINTER);
-
-    PRTSEMEVENTMULTIINTERNAL pEventMultiInt = (PRTSEMEVENTMULTIINTERNAL)RTMemAllocZ(sizeof(*pEventMultiInt));
-    if (pEventMultiInt)
-    {
-        pEventMultiInt->u32Magic = RTSEMEVENTMULTI_MAGIC;
-        pEventMultiInt->cWaiters = 0;
-        pEventMultiInt->cWaking = 0;
-        pEventMultiInt->fSignaled = 0;
-        int rc = RTSpinlockCreate(&pEventMultiInt->hSpinLock);
+RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI phEventMultiSem)
+{
+    return RTSemEventMultiCreateEx(phEventMultiSem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, NULL);
+}
+
+
+RTDECL(int)  RTSemEventMultiCreateEx(PRTSEMEVENTMULTI phEventMultiSem, uint32_t fFlags, RTLOCKVALCLASS hClass,
+                                     const char *pszNameFmt, ...)
+{
+    AssertCompile(sizeof(RTSEMEVENTMULTIINTERNAL) > sizeof(void *));
+    AssertReturn(!(fFlags & ~RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER);
+    AssertPtrReturn(phEventMultiSem, VERR_INVALID_POINTER);
+
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)RTMemAllocZ(sizeof(*pThis));
+    if (pThis)
+    {
+        pThis->u32Magic = RTSEMEVENTMULTI_MAGIC;
+        pThis->cWaiters = 0;
+        pThis->cWaking = 0;
+        pThis->fSignaled = 0;
+        int rc = RTSpinlockCreate(&pThis->hSpinLock);
         if (RT_SUCCESS(rc))
         {
-            *pEventMultiSem = pEventMultiInt;
+            *phEventMultiSem = pThis;
             return VINF_SUCCESS;
         }
 
-        RTMemFree(pEventMultiInt);
+        RTMemFree(pThis);
         return rc;
     }
@@ -90,98 +98,96 @@
 
 
-RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI EventMultiSem)
-{
-    if (EventMultiSem == NIL_RTSEMEVENTMULTI)     /* don't bitch */
-        return VERR_INVALID_HANDLE;
-    PRTSEMEVENTMULTIINTERNAL pEventMultiInt = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
+RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI hEventMultiSem)
+{
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
     RTSPINLOCKTMP            Tmp = RTSPINLOCKTMP_INITIALIZER;
 
-    AssertPtrReturn(pEventMultiInt, VERR_INVALID_HANDLE);
-    AssertMsgReturn(pEventMultiInt->u32Magic == RTSEMEVENTMULTI_MAGIC,
-                    ("pEventMultiInt=%p u32Magic=%#x\n", pEventMultiInt, pEventMultiInt->u32Magic),
+    if (pThis == NIL_RTSEMEVENTMULTI)
+        return VINF_SUCCESS;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
+
+    RTSpinlockAcquire(pThis->hSpinLock, &Tmp);
+    ASMAtomicIncU32(&pThis->u32Magic); /* make the handle invalid */
+    if (pThis->cWaiters > 0)
+    {
+        /* abort waiting thread, last man cleans up. */
+        ASMAtomicXchgU32(&pThis->cWaking, pThis->cWaking + pThis->cWaiters);
+        sleepq_lock(pThis);
+        sleepq_broadcast(pThis, SLEEPQ_CONDVAR, 0, 0);
+        sleepq_release(pThis);
+        RTSpinlockRelease(pThis->hSpinLock, &Tmp);
+    }
+    else if (pThis->cWaking)
+        /* the last waking thread is gonna do the cleanup */
+        RTSpinlockRelease(pThis->hSpinLock, &Tmp);
+    else
+    {
+        RTSpinlockRelease(pThis->hSpinLock, &Tmp);
+        RTSpinlockDestroy(pThis->hSpinLock);
+        RTMemFree(pThis);
+    }
+
+    return VINF_SUCCESS;
+}
+
+
+RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI hEventMultiSem)
+{
+    RTSPINLOCKTMP            Tmp = RTSPINLOCKTMP_INITIALIZER;
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,
+                    ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
                     VERR_INVALID_HANDLE);
 
-    RTSpinlockAcquire(pEventMultiInt->hSpinLock, &Tmp);
-    ASMAtomicIncU32(&pEventMultiInt->u32Magic); /* make the handle invalid */
-    if (pEventMultiInt->cWaiters > 0)
-    {
-        /* abort waiting thread, last man cleans up. */
-        ASMAtomicXchgU32(&pEventMultiInt->cWaking, pEventMultiInt->cWaking + pEventMultiInt->cWaiters);
-        sleepq_lock(pEventMultiInt);
-        sleepq_broadcast(pEventMultiInt, SLEEPQ_CONDVAR, 0, 0);
-        sleepq_release(pEventMultiInt);
-        RTSpinlockRelease(pEventMultiInt->hSpinLock, &Tmp);
-    }
-    else if (pEventMultiInt->cWaking)
-        /* the last waking thread is gonna do the cleanup */
-        RTSpinlockRelease(pEventMultiInt->hSpinLock, &Tmp);
-    else
-    {
-        RTSpinlockRelease(pEventMultiInt->hSpinLock, &Tmp);
-        RTSpinlockDestroy(pEventMultiInt->hSpinLock);
-        RTMemFree(pEventMultiInt);
-    }
-
-    return VINF_SUCCESS;
-}
-
-
-RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI EventMultiSem)
-{
-    RTSPINLOCKTMP            Tmp = RTSPINLOCKTMP_INITIALIZER;
-    PRTSEMEVENTMULTIINTERNAL pEventMultiInt = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
-    AssertPtrReturn(pEventMultiInt, VERR_INVALID_HANDLE);
-    AssertMsgReturn(pEventMultiInt->u32Magic == RTSEMEVENTMULTI_MAGIC,
-                    ("pEventMultiInt=%p u32Magic=%#x\n", pEventMultiInt, pEventMultiInt->u32Magic),
-                    VERR_INVALID_HANDLE);
-
-    RTSpinlockAcquire(pEventMultiInt->hSpinLock, &Tmp);
-
-    ASMAtomicXchgU8(&pEventMultiInt->fSignaled, true);
-    if (pEventMultiInt->cWaiters > 0)
-    {
-        ASMAtomicXchgU32(&pEventMultiInt->cWaking, pEventMultiInt->cWaking + pEventMultiInt->cWaiters);
-        ASMAtomicXchgU32(&pEventMultiInt->cWaiters, 0);
-        sleepq_lock(pEventMultiInt);
-        int fWakeupSwapProc = sleepq_signal(pEventMultiInt, SLEEPQ_CONDVAR, 0, 0);
-        sleepq_release(pEventMultiInt);
+    RTSpinlockAcquire(pThis->hSpinLock, &Tmp);
+
+    ASMAtomicXchgU8(&pThis->fSignaled, true);
+    if (pThis->cWaiters > 0)
+    {
+        ASMAtomicXchgU32(&pThis->cWaking, pThis->cWaking + pThis->cWaiters);
+        ASMAtomicXchgU32(&pThis->cWaiters, 0);
+        sleepq_lock(pThis);
+        int fWakeupSwapProc = sleepq_signal(pThis, SLEEPQ_CONDVAR, 0, 0);
+        sleepq_release(pThis);
         if (fWakeupSwapProc)
             kick_proc0();
     }
 
-    RTSpinlockRelease(pEventMultiInt->hSpinLock, &Tmp);
+    RTSpinlockRelease(pThis->hSpinLock, &Tmp);
     return VINF_SUCCESS;
 }
 
 
-RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI EventMultiSem)
+RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI hEventMultiSem)
 {
     RTSPINLOCKTMP            Tmp = RTSPINLOCKTMP_INITIALIZER;
-    PRTSEMEVENTMULTIINTERNAL pEventMultiInt = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
-    AssertPtrReturn(pEventMultiInt, VERR_INVALID_HANDLE);
-    AssertMsgReturn(pEventMultiInt->u32Magic == RTSEMEVENTMULTI_MAGIC,
-                    ("pEventMultiInt=%p u32Magic=%#x\n", pEventMultiInt, pEventMultiInt->u32Magic),
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,
+                    ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
                     VERR_INVALID_HANDLE);
 
-    RTSpinlockAcquire(pEventMultiInt->hSpinLock, &Tmp);
-    ASMAtomicXchgU8(&pEventMultiInt->fSignaled, false);
-    RTSpinlockRelease(pEventMultiInt->hSpinLock, &Tmp);
+    RTSpinlockAcquire(pThis->hSpinLock, &Tmp);
+    ASMAtomicXchgU8(&pThis->fSignaled, false);
+    RTSpinlockRelease(pThis->hSpinLock, &Tmp);
     return VINF_SUCCESS;
 }
 
 
-static int rtSemEventMultiWait(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies, bool fInterruptible)
+static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies, bool fInterruptible)
 {
     int rc;
     RTSPINLOCKTMP            Tmp = RTSPINLOCKTMP_INITIALIZER;
-    PRTSEMEVENTMULTIINTERNAL pEventMultiInt = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
-    AssertPtrReturn(pEventMultiInt, VERR_INVALID_HANDLE);
-    AssertMsgReturn(pEventMultiInt->u32Magic == RTSEMEVENTMULTI_MAGIC,
-                    ("pEventMultiInt=%p u32Magic=%#x\n", pEventMultiInt, pEventMultiInt->u32Magic),
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,
+                    ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
                     VERR_INVALID_HANDLE);
 
-    RTSpinlockAcquire(pEventMultiInt->hSpinLock, &Tmp);
-
-    if (pEventMultiInt->fSignaled)
+    RTSpinlockAcquire(pThis->hSpinLock, &Tmp);
+
+    if (pThis->fSignaled)
         rc = VINF_SUCCESS;
     else
@@ -191,5 +197,5 @@
         else
         {
-            ASMAtomicIncU32(&pEventMultiInt->cWaiters);
+            ASMAtomicIncU32(&pThis->cWaiters);
 
             int fFlags = SLEEPQ_CONDVAR;
@@ -198,6 +204,6 @@
                 fFlags |= SLEEPQ_INTERRUPTIBLE;
 
-            sleepq_lock(pEventMultiInt);
-            sleepq_add(pEventMultiInt, NULL, "IPRT Event Semaphore", fFlags, 0);
+            sleepq_lock(pThis);
+            sleepq_add(pThis, NULL, "IPRT Event Semaphore", fFlags, 0);
 
             if (cMillies != RT_INDEFINITE_WAIT)
@@ -211,34 +217,34 @@
                 tv.tv_usec = (cMillies % 1000) * 1000;
 
-                sleepq_set_timeout(pEventMultiInt, tvtohz(&tv));
-
-                RTSpinlockRelease(pEventMultiInt->hSpinLock, &Tmp);
+                sleepq_set_timeout(pThis, tvtohz(&tv));
+
+                RTSpinlockRelease(pThis->hSpinLock, &Tmp);
 
                 if (fInterruptible)
-                    rc = SLEEPQ_TIMEDWAIT_SIG(pEventMultiInt);
+                    rc = SLEEPQ_TIMEDWAIT_SIG(pThis);
                 else
-                    rc = SLEEPQ_TIMEDWAIT(pEventMultiInt);
+                    rc = SLEEPQ_TIMEDWAIT(pThis);
             }
             else
             {
-                RTSpinlockRelease(pEventMultiInt->hSpinLock, &Tmp);
+                RTSpinlockRelease(pThis->hSpinLock, &Tmp);
 
                 if (fInterruptible)
-                    rc = SLEEPQ_WAIT_SIG(pEventMultiInt);
+                    rc = SLEEPQ_WAIT_SIG(pThis);
                 else
                 {
                     rc = 0;
-                    SLEEPQ_WAIT(pEventMultiInt);
+                    SLEEPQ_WAIT(pThis);
                 }
             }
 
-            RTSpinlockAcquire(pEventMultiInt->hSpinLock, &Tmp);
+            RTSpinlockAcquire(pThis->hSpinLock, &Tmp);
 
             switch (rc)
             {
                 case 0:
-                    if (pEventMultiInt->u32Magic == RTSEMEVENTMULTI_MAGIC)
+                    if (pThis->u32Magic == RTSEMEVENTMULTI_MAGIC)
                     {
-                        ASMAtomicDecU32(&pEventMultiInt->cWaking);
+                        ASMAtomicDecU32(&pThis->cWaking);
                         rc = VINF_SUCCESS;
                     }
@@ -247,11 +253,11 @@
                         rc = VERR_SEM_DESTROYED; /** @todo this isn't necessarily correct, we've
                                                   * could've woken up just before destruction... */
-                        if (!ASMAtomicDecU32(&pEventMultiInt->cWaking))
+                        if (!ASMAtomicDecU32(&pThis->cWaking))
                         {
                             /* The event was destroyed, as the last thread do the cleanup.
                                we don't actually know whether */
-                            RTSpinlockRelease(pEventMultiInt->hSpinLock, &Tmp);
-                            RTSpinlockDestroy(pEventMultiInt->hSpinLock);
-                            RTMemFree(pEventMultiInt);
+                            RTSpinlockRelease(pThis->hSpinLock, &Tmp);
+                            RTSpinlockDestroy(pThis->hSpinLock);
+                            RTMemFree(pThis);
                             return rc;
                         }
@@ -261,6 +267,6 @@
                 case EWOULDBLOCK:
                     Assert(cMillies != RT_INDEFINITE_WAIT);
-                    if (pEventMultiInt->cWaiters > 0)
-                        ASMAtomicDecU32(&pEventMultiInt->cWaiters);
+                    if (pThis->cWaiters > 0)
+                        ASMAtomicDecU32(&pThis->cWaiters);
                     rc = VERR_TIMEOUT;
                     break;
@@ -269,6 +275,6 @@
                 case ERESTART:
                     Assert(fInterruptible);
-                    if (pEventMultiInt->cWaiters > 0)
-                        ASMAtomicDecU32(&pEventMultiInt->cWaiters);
+                    if (pThis->cWaiters > 0)
+                        ASMAtomicDecU32(&pThis->cWaiters);
                     rc = VERR_INTERRUPTED;
                     break;
@@ -282,18 +288,18 @@
     }
 
-    RTSpinlockRelease(pEventMultiInt->hSpinLock, &Tmp);
+    RTSpinlockRelease(pThis->hSpinLock, &Tmp);
     return rc;
 }
 
 
-RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
-{
-    return rtSemEventMultiWait(EventMultiSem, cMillies, false /* not interruptible */);
-}
-
-
-RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
-{
-    return rtSemEventMultiWait(EventMultiSem, cMillies, true /* interruptible */);
-}
-
+RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
+{
+    return rtSemEventMultiWait(hEventMultiSem, cMillies, false /* not interruptible */);
+}
+
+
+RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
+{
+    return rtSemEventMultiWait(hEventMultiSem, cMillies, true /* interruptible */);
+}
+
Index: /trunk/src/VBox/Runtime/r0drv/linux/semeventmulti-r0drv-linux.c
===================================================================
--- /trunk/src/VBox/Runtime/r0drv/linux/semeventmulti-r0drv-linux.c	(revision 25719)
+++ /trunk/src/VBox/Runtime/r0drv/linux/semeventmulti-r0drv-linux.c	(revision 25720)
@@ -62,6 +62,15 @@
 
 
-RTDECL(int) RTSemEventMultiCreate(PRTSEMEVENTMULTI pEventMultiSem)
-{
+RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI phEventMultiSem)
+{
+    return RTSemEventMultiCreateEx(phEventMultiSem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, NULL);
+}
+
+
+RTDECL(int)  RTSemEventMultiCreateEx(PRTSEMEVENTMULTI phEventMultiSem, uint32_t fFlags, RTLOCKVALCLASS hClass,
+                                     const char *pszNameFmt, ...)
+{
+    AssertReturn(!(fFlags & ~RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER);
+
     PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)RTMemAlloc(sizeof(*pThis));
     if (pThis)
@@ -70,5 +79,6 @@
         pThis->fState   = 0;
         init_waitqueue_head(&pThis->Head);
-        *pEventMultiSem = pThis;
+
+        *phEventMultiSem = pThis;
         return VINF_SUCCESS;
     }
@@ -78,12 +88,12 @@
 
 
-RTDECL(int) RTSemEventMultiDestroy(RTSEMEVENTMULTI EventMultiSem)
+RTDECL(int) RTSemEventMultiDestroy(RTSEMEVENTMULTI hEventMultiSem)
 {
     /*
      * Validate input.
      */
-    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
-    if (!pThis)
-        return VERR_INVALID_PARAMETER;
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
+    if (pThis == NIL_RTSEMEVENTMULTI)
+        return VINF_SUCCESS;
     AssertPtrReturn(pThis, VERR_INVALID_PARAMETER);
     AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, ("%p u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_PARAMETER);
@@ -92,5 +102,5 @@
      * Invalidate it and signal the object just in case.
      */
-    ASMAtomicIncU32(&pThis->u32Magic);
+    ASMAtomicWriteU32(&pThis->u32Magic, ~RTSEMEVENTMULTI_MAGIC);
     ASMAtomicXchgU32(&pThis->fState, 0);
     Assert(!waitqueue_active(&pThis->Head));
@@ -102,10 +112,10 @@
 
 
-RTDECL(int) RTSemEventMultiSignal(RTSEMEVENTMULTI EventMultiSem)
+RTDECL(int) RTSemEventMultiSignal(RTSEMEVENTMULTI hEventMultiSem)
 {
     /*
      * Validate input.
      */
-    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
     if (!pThis)
         return VERR_INVALID_PARAMETER;
@@ -123,10 +133,10 @@
 
 
-RTDECL(int) RTSemEventMultiReset(RTSEMEVENTMULTI EventMultiSem)
+RTDECL(int) RTSemEventMultiReset(RTSEMEVENTMULTI hEventMultiSem)
 {
     /*
      * Validate input.
      */
-    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
     if (!pThis)
         return VERR_INVALID_PARAMETER;
@@ -206,7 +216,7 @@
 
 
-RTDECL(int) RTSemEventMultiWait(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
-{
-    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
+RTDECL(int) RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
+{
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
     if (!pThis)
         return VERR_INVALID_PARAMETER;
@@ -221,7 +231,7 @@
 
 
-RTDECL(int) RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
-{
-    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
+RTDECL(int) RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
+{
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
     if (!pThis)
         return VERR_INVALID_PARAMETER;
Index: /trunk/src/VBox/Runtime/r0drv/nt/semeventmulti-r0drv-nt.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r0drv/nt/semeventmulti-r0drv-nt.cpp	(revision 25719)
+++ /trunk/src/VBox/Runtime/r0drv/nt/semeventmulti-r0drv-nt.cpp	(revision 25720)
@@ -58,7 +58,16 @@
 
 
-RTDECL(int) RTSemEventMultiCreate(PRTSEMEVENTMULTI pEventSem)
+RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI phEventMultiSem)
 {
-    Assert(sizeof(RTSEMEVENTMULTIINTERNAL) > sizeof(void *));
+    return RTSemEventMultiCreateEx(phEventMultiSem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, NULL);
+}
+
+
+RTDECL(int)  RTSemEventMultiCreateEx(PRTSEMEVENTMULTI phEventMultiSem, uint32_t fFlags, RTLOCKVALCLASS hClass,
+                                     const char *pszNameFmt, ...)
+{
+    AssertReturn(!(fFlags & ~RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER);
+
+    AssertCompile(sizeof(RTSEMEVENTMULTIINTERNAL) > sizeof(void *));
     PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)RTMemAlloc(sizeof(*pThis));
     if (pThis)
@@ -66,5 +75,6 @@
         pThis->u32Magic = RTSEMEVENTMULTI_MAGIC;
         KeInitializeEvent(&pThis->Event, NotificationEvent, FALSE /* not signalled */);
-        *pEventSem = pThis;
+
+        *phEventSem = pThis;
         return VINF_SUCCESS;
     }
@@ -73,12 +83,12 @@
 
 
-RTDECL(int) RTSemEventMultiDestroy(RTSEMEVENTMULTI EventMultiSem)
+RTDECL(int) RTSemEventMultiDestroy(RTSEMEVENTMULTI hEventMultiSem)
 {
     /*
      * Validate input.
      */
-    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
-    if (!pThis)
-        return VERR_INVALID_PARAMETER;
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
+    if (pThis == NIL_RTSEMEVENTMULTI)
+        return VINF_SUCCESS;
     AssertPtrReturn(pThis, VERR_INVALID_PARAMETER);
     AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, ("%p u32Magic=%RX32\n", pThis, pThis->u32Magic), VERR_INVALID_PARAMETER);
@@ -94,10 +104,10 @@
 
 
-RTDECL(int) RTSemEventMultiSignal(RTSEMEVENTMULTI EventMultiSem)
+RTDECL(int) RTSemEventMultiSignal(RTSEMEVENTMULTI hEventMultiSem)
 {
     /*
      * Validate input.
      */
-    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
     if (!pThis)
         return VERR_INVALID_PARAMETER;
@@ -113,10 +123,10 @@
 
 
-RTDECL(int) RTSemEventMultiReset(RTSEMEVENTMULTI EventMultiSem)
+RTDECL(int) RTSemEventMultiReset(RTSEMEVENTMULTI hEventMultiSem)
 {
     /*
      * Validate input.
      */
-    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
     if (!pThis)
         return VERR_INVALID_PARAMETER;
@@ -132,10 +142,10 @@
 
 
-static int rtSemEventMultiWait(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies, bool fInterruptible)
+static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies, bool fInterruptible)
 {
     /*
      * Validate input.
      */
-    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
     if (!pThis)
         return VERR_INVALID_PARAMETER;
@@ -177,13 +187,13 @@
 
 
-RTDECL(int) RTSemEventMultiWait(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
+RTDECL(int) RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
 {
-    return rtSemEventMultiWait(EventMultiSem, cMillies, false /* fInterruptible */);
+    return rtSemEventMultiWait(hEventMultiSem, cMillies, false /* fInterruptible */);
 }
 
 
-RTDECL(int) RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
+RTDECL(int) RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
 {
-    return rtSemEventMultiWait(EventMultiSem, cMillies, true /* fInterruptible */);
+    return rtSemEventMultiWait(hEventMultiSem, cMillies, true /* fInterruptible */);
 }
 
Index: /trunk/src/VBox/Runtime/r0drv/os2/semeventmulti-r0drv-os2.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r0drv/os2/semeventmulti-r0drv-os2.cpp	(revision 25719)
+++ /trunk/src/VBox/Runtime/r0drv/os2/semeventmulti-r0drv-os2.cpp	(revision 25720)
@@ -64,18 +64,27 @@
 
 
-RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI pEventMultiSem)
-{
-    Assert(sizeof(RTSEMEVENTMULTIINTERNAL) > sizeof(void *));
-    AssertPtrReturn(pEventMultiSem, VERR_INVALID_POINTER);
-
-    PRTSEMEVENTMULTIINTERNAL pEventMultiInt = (PRTSEMEVENTMULTIINTERNAL)RTMemAlloc(sizeof(*pEventMultiInt));
-    if (pEventMultiInt)
-    {
-        pEventMultiInt->u32Magic = RTSEMEVENTMULTI_MAGIC;
-        pEventMultiInt->cWaiters = 0;
-        pEventMultiInt->cWaking = 0;
-        pEventMultiInt->fSignaled = 0;
-        KernAllocSpinLock(&pEventMultiInt->Spinlock);
-        *pEventMultiSem = pEventMultiInt;
+RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI phEventMultiSem)
+{
+    return RTSemEventMultiCreateEx(phEventMultiSem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, NULL);
+}
+
+
+RTDECL(int)  RTSemEventMultiCreateEx(PRTSEMEVENTMULTI phEventMultiSem, uint32_t fFlags, RTLOCKVALCLASS hClass,
+                                     const char *pszNameFmt, ...)
+{
+    AssertReturn(!(fFlags & ~RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER);
+    AssertPtrReturn(phEventMultiSem, VERR_INVALID_POINTER);
+
+    AssertCompile(sizeof(RTSEMEVENTMULTIINTERNAL) > sizeof(void *));
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)RTMemAlloc(sizeof(*pThis));
+    if (pThis)
+    {
+        pThis->u32Magic = RTSEMEVENTMULTI_MAGIC;
+        pThis->cWaiters = 0;
+        pThis->cWaking = 0;
+        pThis->fSignaled = 0;
+        KernAllocSpinLock(&pThis->Spinlock);
+
+        *phEventMultiSem = pThis;
         return VINF_SUCCESS;
     }
@@ -84,99 +93,97 @@
 
 
-RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI EventMultiSem)
-{
-    if (EventMultiSem == NIL_RTSEMEVENTMULTI)     /* don't bitch */
-        return VERR_INVALID_HANDLE;
-    PRTSEMEVENTMULTIINTERNAL pEventMultiInt = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
-    AssertPtrReturn(pEventMultiInt, VERR_INVALID_HANDLE);
-    AssertMsgReturn(pEventMultiInt->u32Magic == RTSEMEVENTMULTI_MAGIC,
-                    ("pEventMultiInt=%p u32Magic=%#x\n", pEventMultiInt, pEventMultiInt->u32Magic),
+RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI hEventMultiSem)
+{
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
+    if (pThis == NIL_RTSEMEVENTMULTI)
+        return VINF_SUCCESS;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
+
+    KernAcquireSpinLock(&pThis->Spinlock);
+    ASMAtomicIncU32(&pThis->u32Magic); /* make the handle invalid */
+    if (pThis->cWaiters > 0)
+    {
+        /* abort waiting thread, last man cleans up. */
+        ASMAtomicXchgU32(&pThis->cWaking, pThis->cWaking + pThis->cWaiters);
+        ULONG cThreads;
+        KernWakeup((ULONG)pThis, WAKEUP_DATA | WAKEUP_BOOST, &cThreads, (ULONG)VERR_SEM_DESTROYED);
+        KernReleaseSpinLock(&pThis->Spinlock);
+    }
+    else if (pThis->cWaking)
+        /* the last waking thread is gonna do the cleanup */
+        KernReleaseSpinLock(&pThis->Spinlock);
+    else
+    {
+        KernReleaseSpinLock(&pThis->Spinlock);
+        KernFreeSpinLock(&pThis->Spinlock);
+        RTMemFree(pThis);
+    }
+
+    return VINF_SUCCESS;
+}
+
+
+RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI hEventMultiSem)
+{
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,
+                    ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
                     VERR_INVALID_HANDLE);
 
-    KernAcquireSpinLock(&pEventMultiInt->Spinlock);
-    ASMAtomicIncU32(&pEventMultiInt->u32Magic); /* make the handle invalid */
-    if (pEventMultiInt->cWaiters > 0)
-    {
-        /* abort waiting thread, last man cleans up. */
-        ASMAtomicXchgU32(&pEventMultiInt->cWaking, pEventMultiInt->cWaking + pEventMultiInt->cWaiters);
+    KernAcquireSpinLock(&pThis->Spinlock);
+
+    ASMAtomicXchgU8(&pThis->fSignaled, true);
+    if (pThis->cWaiters > 0)
+    {
+        ASMAtomicXchgU32(&pThis->cWaking, pThis->cWaking + pThis->cWaiters);
+        ASMAtomicXchgU32(&pThis->cWaiters, 0);
         ULONG cThreads;
-        KernWakeup((ULONG)pEventMultiInt, WAKEUP_DATA | WAKEUP_BOOST, &cThreads, (ULONG)VERR_SEM_DESTROYED);
-        KernReleaseSpinLock(&pEventMultiInt->Spinlock);
-    }
-    else if (pEventMultiInt->cWaking)
-        /* the last waking thread is gonna do the cleanup */
-        KernReleaseSpinLock(&pEventMultiInt->Spinlock);
-    else
-    {
-        KernReleaseSpinLock(&pEventMultiInt->Spinlock);
-        KernFreeSpinLock(&pEventMultiInt->Spinlock);
-        RTMemFree(pEventMultiInt);
-    }
-
+        KernWakeup((ULONG)pThis, WAKEUP_DATA, &cThreads, VINF_SUCCESS);
+    }
+
+    KernReleaseSpinLock(&pThis->Spinlock);
     return VINF_SUCCESS;
 }
 
 
-RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI EventMultiSem)
-{
-    PRTSEMEVENTMULTIINTERNAL pEventMultiInt = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
-    AssertPtrReturn(pEventMultiInt, VERR_INVALID_HANDLE);
-    AssertMsgReturn(pEventMultiInt->u32Magic == RTSEMEVENTMULTI_MAGIC,
-                    ("pEventMultiInt=%p u32Magic=%#x\n", pEventMultiInt, pEventMultiInt->u32Magic),
+RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI hEventMultiSem)
+{
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,
+                    ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
                     VERR_INVALID_HANDLE);
 
-    KernAcquireSpinLock(&pEventMultiInt->Spinlock);
-
-    ASMAtomicXchgU8(&pEventMultiInt->fSignaled, true);
-    if (pEventMultiInt->cWaiters > 0)
-    {
-        ASMAtomicXchgU32(&pEventMultiInt->cWaking, pEventMultiInt->cWaking + pEventMultiInt->cWaiters);
-        ASMAtomicXchgU32(&pEventMultiInt->cWaiters, 0);
-        ULONG cThreads;
-        KernWakeup((ULONG)pEventMultiInt, WAKEUP_DATA, &cThreads, VINF_SUCCESS);
-    }
-
-    KernReleaseSpinLock(&pEventMultiInt->Spinlock);
+    KernAcquireSpinLock(&pThis->Spinlock);
+    ASMAtomicXchgU8(&pThis->fSignaled, false);
+    KernReleaseSpinLock(&pThis->Spinlock);
     return VINF_SUCCESS;
 }
 
 
-RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI EventMultiSem)
-{
-    PRTSEMEVENTMULTIINTERNAL pEventMultiInt = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
-    AssertPtrReturn(pEventMultiInt, VERR_INVALID_HANDLE);
-    AssertMsgReturn(pEventMultiInt->u32Magic == RTSEMEVENTMULTI_MAGIC,
-                    ("pEventMultiInt=%p u32Magic=%#x\n", pEventMultiInt, pEventMultiInt->u32Magic),
+static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies, bool fInterruptible)
+{
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,
+                    ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
                     VERR_INVALID_HANDLE);
 
-    KernAcquireSpinLock(&pEventMultiInt->Spinlock);
-    ASMAtomicXchgU8(&pEventMultiInt->fSignaled, false);
-    KernReleaseSpinLock(&pEventMultiInt->Spinlock);
-    return VINF_SUCCESS;
-}
-
-
-static int rtSemEventMultiWait(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies, bool fInterruptible)
-{
-    PRTSEMEVENTMULTIINTERNAL pEventMultiInt = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
-    AssertPtrReturn(pEventMultiInt, VERR_INVALID_HANDLE);
-    AssertMsgReturn(pEventMultiInt->u32Magic == RTSEMEVENTMULTI_MAGIC,
-                    ("pEventMultiInt=%p u32Magic=%#x\n", pEventMultiInt, pEventMultiInt->u32Magic),
-                    VERR_INVALID_HANDLE);
-
-    KernAcquireSpinLock(&pEventMultiInt->Spinlock);
+    KernAcquireSpinLock(&pThis->Spinlock);
 
     int rc;
-    if (pEventMultiInt->fSignaled)
+    if (pThis->fSignaled)
         rc = VINF_SUCCESS;
     else
     {
-        ASMAtomicIncU32(&pEventMultiInt->cWaiters);
+        ASMAtomicIncU32(&pThis->cWaiters);
 
         ULONG ulData = (ULONG)VERR_INTERNAL_ERROR;
-        rc = KernBlock((ULONG)pEventMultiInt,
+        rc = KernBlock((ULONG)pThis,
                        cMillies == RT_INDEFINITE_WAIT ? SEM_INDEFINITE_WAIT : cMillies,
                        BLOCK_SPINLOCK | (!fInterruptible ? BLOCK_UNINTERRUPTABLE : 0),
-                       &pEventMultiInt->Spinlock,
+                       &pThis->Spinlock,
                        &ulData);
         switch (rc)
@@ -185,13 +192,13 @@
                 rc = (int)ulData;
                 Assert(rc == VINF_SUCCESS || rc == VERR_SEM_DESTROYED);
-                Assert(pEventMultiInt->cWaking > 0);
-                if (    !ASMAtomicDecU32(&pEventMultiInt->cWaking)
-                    &&  pEventMultiInt->u32Magic != RTSEMEVENTMULTI_MAGIC)
+                Assert(pThis->cWaking > 0);
+                if (    !ASMAtomicDecU32(&pThis->cWaking)
+                    &&  pThis->u32Magic != RTSEMEVENTMULTI_MAGIC)
                 {
                     /* The event was destroyed (ulData == VINF_SUCCESS if it was after we awoke), as
                        the last thread do the cleanup. */
-                    KernReleaseSpinLock(&pEventMultiInt->Spinlock);
-                    KernFreeSpinLock(&pEventMultiInt->Spinlock);
-                    RTMemFree(pEventMultiInt);
+                    KernReleaseSpinLock(&pThis->Spinlock);
+                    KernFreeSpinLock(&pThis->Spinlock);
+                    RTMemFree(pThis);
                     return VINF_SUCCESS;
                 }
@@ -201,5 +208,5 @@
             case ERROR_TIMEOUT:
                 Assert(cMillies != RT_INDEFINITE_WAIT);
-                ASMAtomicDecU32(&pEventMultiInt->cWaiters);
+                ASMAtomicDecU32(&pThis->cWaiters);
                 rc = VERR_TIMEOUT;
                 break;
@@ -207,5 +214,5 @@
             case ERROR_INTERRUPT:
                 Assert(fInterruptible);
-                ASMAtomicDecU32(&pEventMultiInt->cWaiters);
+                ASMAtomicDecU32(&pThis->cWaiters);
                 rc = VERR_INTERRUPTED;
                 break;
@@ -218,18 +225,18 @@
     }
 
-    KernReleaseSpinLock(&pEventMultiInt->Spinlock);
+    KernReleaseSpinLock(&pThis->Spinlock);
     return rc;
 }
 
 
-RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
-{
-    return rtSemEventMultiWait(EventMultiSem, cMillies, false /* not interruptible */);
-}
-
-
-RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
-{
-    return rtSemEventMultiWait(EventMultiSem, cMillies, true /* interruptible */);
-}
-
+RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
+{
+    return rtSemEventMultiWait(hEventMultiSem, cMillies, false /* not interruptible */);
+}
+
+
+RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
+{
+    return rtSemEventMultiWait(hEventMultiSem, cMillies, true /* interruptible */);
+}
+
Index: /trunk/src/VBox/Runtime/r0drv/solaris/semeventmulti-r0drv-solaris.c
===================================================================
--- /trunk/src/VBox/Runtime/r0drv/solaris/semeventmulti-r0drv-solaris.c	(revision 25719)
+++ /trunk/src/VBox/Runtime/r0drv/solaris/semeventmulti-r0drv-solaris.c	(revision 25720)
@@ -70,10 +70,18 @@
 
 
-RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI pEventMultiSem)
-{
-    Assert(sizeof(RTSEMEVENTMULTIINTERNAL) > sizeof(void *));
-    AssertPtrReturn(pEventMultiSem, VERR_INVALID_POINTER);
+RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI phEventMultiSem)
+{
+    return RTSemEventMultiCreateEx(phEventMultiSem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, NULL);
+}
+
+
+RTDECL(int)  RTSemEventMultiCreateEx(PRTSEMEVENTMULTI phEventMultiSem, uint32_t fFlags, RTLOCKVALCLASS hClass,
+                                     const char *pszNameFmt, ...)
+{
+    AssertReturn(!(fFlags & ~RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER);
+    AssertPtrReturn(phEventMultiSem, VERR_INVALID_POINTER);
     RT_ASSERT_PREEMPTIBLE();
 
+    AssertCompile(sizeof(RTSEMEVENTMULTIINTERNAL) > sizeof(void *));
     PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)RTMemAlloc(sizeof(*pThis));
     if (pThis)
@@ -85,5 +93,6 @@
         mutex_init(&pThis->Mtx, "IPRT Multiple Release Event Semaphore", MUTEX_DRIVER, (void *)ipltospl(DISP_LEVEL));
         cv_init(&pThis->Cnd, "IPRT CV", CV_DRIVER, NULL);
-        *pEventMultiSem = pThis;
+
+        *phEventMultiSem = pThis;
         return VINF_SUCCESS;
     }
@@ -92,13 +101,11 @@
 
 
-RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI EventMultiSem)
-{
-    if (EventMultiSem == NIL_RTSEMEVENTMULTI)     /* don't bitch */
-        return VERR_INVALID_HANDLE;
-    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
+RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI hEventMultiSem)
+{
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
+    if (pThis == NIL_RTSEMEVENTMULTI)
+        return VINF_SUCCESS;
     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
-    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,
-                    ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic),
-                    VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, ("pThis=%p u32Magic=%#x\n", pThis, pThis->u32Magic), VERR_INVALID_HANDLE);
     RT_ASSERT_INTS_ON();
 
@@ -127,7 +134,7 @@
 
 
-RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI EventMultiSem)
-{
-    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
+RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI hEventMultiSem)
+{
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
     RT_ASSERT_PREEMPT_CPUID_VAR();
 
@@ -172,7 +179,7 @@
 
 
-RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI EventMultiSem)
-{
-    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
+RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI hEventMultiSem)
+{
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
     RT_ASSERT_PREEMPT_CPUID_VAR();
 
@@ -210,8 +217,8 @@
 
 
-static int rtSemEventMultiWait(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies, bool fInterruptible)
+static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies, bool fInterruptible)
 {
     int rc;
-    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)EventMultiSem;
+    PRTSEMEVENTMULTIINTERNAL pThis = (PRTSEMEVENTMULTIINTERNAL)hEventMultiSem;
     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     AssertMsgReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,
@@ -294,13 +301,13 @@
 
 
-RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
-{
-    return rtSemEventMultiWait(EventMultiSem, cMillies, false /* not interruptible */);
-}
-
-
-RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
-{
-    return rtSemEventMultiWait(EventMultiSem, cMillies, true /* interruptible */);
-}
-
+RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
+{
+    return rtSemEventMultiWait(hEventMultiSem, cMillies, false /* not interruptible */);
+}
+
+
+RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
+{
+    return rtSemEventMultiWait(hEventMultiSem, cMillies, true /* interruptible */);
+}
+
Index: /trunk/src/VBox/Runtime/r3/linux/semeventmulti-linux.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/linux/semeventmulti-linux.cpp	(revision 25719)
+++ /trunk/src/VBox/Runtime/r3/linux/semeventmulti-linux.cpp	(revision 25720)
@@ -31,5 +31,5 @@
 
 #include <features.h>
-#if __GLIBC_PREREQ(2,6) && !defined(IPRT_WITH_FUTEX_BASED_SEMS) && !defined(DEBUG_bird)
+#if __GLIBC_PREREQ(2,6) && !defined(IPRT_WITH_FUTEX_BASED_SEMS)
 
 /*
@@ -119,6 +119,15 @@
 
 
-RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI pEventMultiSem)
-{
+RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI phEventMultiSem)
+{
+    return RTSemEventMultiCreateEx(phEventMultiSem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, NULL);
+}
+
+
+RTDECL(int)  RTSemEventMultiCreateEx(PRTSEMEVENTMULTI phEventMultiSem, uint32_t fFlags, RTLOCKVALCLASS hClass,
+                                     const char *pszNameFmt, ...)
+{
+    AssertReturn(!(fFlags & ~RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER);
+
     /*
      * Allocate semaphore handle.
@@ -130,10 +139,14 @@
         pThis->iState   = 0;
 #ifdef RTSEMEVENTMULTI_STRICT
-        RTLockValidatorRecSharedInit(&pThis->Signallers,
-                                     NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_ANY,
-                                     pThis, true /*fSignaller*/, true /*fEnabled*/, "RTSemEvent");
+        va_list va;
+        va_start(va, pszNameFmt);
+        RTLockValidatorRecSharedInitV(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis,
+                                      true /*fSignaller*/, !(fFlags & RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL),
+                                      pszNameFmt, va);
+        va_end(va);
         pThis->fEverHadSignallers = false;
 #endif
-        *pEventMultiSem = pThis;
+
+        *phEventMultiSem = pThis;
         return VINF_SUCCESS;
     }
@@ -142,12 +155,14 @@
 
 
-RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI EventMultiSem)
+RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI hEventMultiSem)
 {
     /*
      * Validate input.
      */
-    struct RTSEMEVENTMULTIINTERNAL *pThis = EventMultiSem;
-    AssertReturn(VALID_PTR(pThis) && pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,
-                 VERR_INVALID_HANDLE);
+    struct RTSEMEVENTMULTIINTERNAL *pThis = hEventMultiSem;
+    if (pThis == NIL_RTSEMEVENTMULTI)
+        return VINF_SUCCESS;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, VERR_INVALID_HANDLE);
 
     /*
@@ -172,10 +187,10 @@
 
 
-RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI EventMultiSem)
+RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI hEventMultiSem)
 {
     /*
      * Validate input.
      */
-    struct RTSEMEVENTMULTIINTERNAL *pThis = EventMultiSem;
+    struct RTSEMEVENTMULTIINTERNAL *pThis = hEventMultiSem;
     AssertReturn(VALID_PTR(pThis) && pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,
                  VERR_INVALID_HANDLE);
@@ -206,10 +221,10 @@
 
 
-RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI EventMultiSem)
+RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI hEventMultiSem)
 {
     /*
      * Validate input.
      */
-    struct RTSEMEVENTMULTIINTERNAL *pThis = EventMultiSem;
+    struct RTSEMEVENTMULTIINTERNAL *pThis = hEventMultiSem;
     AssertReturn(VALID_PTR(pThis) && pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,
                  VERR_INVALID_HANDLE);
@@ -227,5 +242,5 @@
 
 
-static int rtSemEventMultiWait(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies, bool fAutoResume)
+static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies, bool fAutoResume)
 {
     PCRTLOCKVALSRCPOS pSrcPos = NULL;
@@ -234,5 +249,5 @@
      * Validate input.
      */
-    struct RTSEMEVENTMULTIINTERNAL *pThis = EventMultiSem;
+    struct RTSEMEVENTMULTIINTERNAL *pThis = hEventMultiSem;
     AssertReturn(VALID_PTR(pThis) && pThis->u32Magic == RTSEMEVENTMULTI_MAGIC,
                  VERR_INVALID_HANDLE);
@@ -339,7 +354,7 @@
 
 
-RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
-{
-    int rc = rtSemEventMultiWait(EventMultiSem, cMillies, true);
+RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
+{
+    int rc = rtSemEventMultiWait(hEventMultiSem, cMillies, true);
     Assert(rc != VERR_INTERRUPTED);
     return rc;
@@ -347,7 +362,7 @@
 
 
-RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
-{
-    return rtSemEventMultiWait(EventMultiSem, cMillies, false);
+RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
+{
+    return rtSemEventMultiWait(hEventMultiSem, cMillies, false);
 }
 
Index: /trunk/src/VBox/Runtime/r3/os2/sems-os2.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/os2/sems-os2.cpp	(revision 25719)
+++ /trunk/src/VBox/Runtime/r3/os2/sems-os2.cpp	(revision 25720)
@@ -148,6 +148,15 @@
 
 
-RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI pEventMultiSem)
-{
+RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI phEventMultiSem)
+{
+    return RTSemEventMultiCreateEx(phEventMultiSem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, NULL);
+}
+
+
+RTDECL(int)  RTSemEventMultiCreateEx(PRTSEMEVENTMULTI phEventMultiSem, uint32_t fFlags, RTLOCKVALCLASS hClass,
+                                     const char *pszNameFmt, ...)
+{
+    AssertReturn(!(fFlags & ~RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER);
+
     /*
      * Create the semaphore.
@@ -158,30 +167,33 @@
     if (!rc)
     {
-        *pEventMultiSem = (RTSEMEVENTMULTI)(void *)hev;
-        return VINF_SUCCESS;
-    }
-    return RTErrConvertFromOS2(rc);
-}
-
-
-RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI EventMultiSem)
-{
+        *phEventMultiSem = (RTSEMEVENTMULTI)(void *)hev;
+        return VINF_SUCCESS;
+    }
+    return RTErrConvertFromOS2(rc);
+}
+
+
+RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI hEventMultiSem)
+{
+    if (hEventMultiSem == NIL_RTSEMEVENTMULTI)
+        return VINF_SUCCESS;
+
     /*
      * Close semaphore handle.
      */
-    int rc = DosCloseEventSem(SEM2HND(EventMultiSem));
-    if (!rc)
-        return VINF_SUCCESS;
-    AssertMsgFailed(("Destroy EventMultiSem %p failed, rc=%d\n", EventMultiSem, rc));
-    return RTErrConvertFromOS2(rc);
-}
-
-
-RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI EventMultiSem)
+    int rc = DosCloseEventSem(SEM2HND(hEventMultiSem));
+    if (!rc)
+        return VINF_SUCCESS;
+    AssertMsgFailed(("Destroy hEventMultiSem %p failed, rc=%d\n", hEventMultiSem, rc));
+    return RTErrConvertFromOS2(rc);
+}
+
+
+RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI hEventMultiSem)
 {
     /*
      * Signal the object.
      */
-    int rc = DosPostEventSem(SEM2HND(EventMultiSem));
+    int rc = DosPostEventSem(SEM2HND(hEventMultiSem));
     switch (rc)
     {
@@ -196,5 +208,5 @@
 
 
-RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI EventMultiSem)
+RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI hEventMultiSem)
 {
     /*
@@ -202,5 +214,5 @@
      */
     ULONG ulIgnore;
-    int rc = DosResetEventSem(SEM2HND(EventMultiSem), &ulIgnore);
+    int rc = DosResetEventSem(SEM2HND(hEventMultiSem), &ulIgnore);
     switch (rc)
     {
@@ -214,10 +226,10 @@
 
 
-RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
+RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
 {
     /*
      * Wait for condition.
      */
-    int rc = DosWaitEventSem(SEM2HND(EventMultiSem), cMillies == RT_INDEFINITE_WAIT ? SEM_INDEFINITE_WAIT : cMillies);
+    int rc = DosWaitEventSem(SEM2HND(hEventMultiSem), cMillies == RT_INDEFINITE_WAIT ? SEM_INDEFINITE_WAIT : cMillies);
     switch (rc)
     {
@@ -228,5 +240,5 @@
         default:
         {
-            AssertMsgFailed(("Wait on EventMultiSem %p failed, rc=%d\n", EventMultiSem, rc));
+            AssertMsgFailed(("Wait on hEventMultiSem %p failed, rc=%d\n", hEventMultiSem, rc));
             return RTErrConvertFromOS2(rc);
         }
Index: /trunk/src/VBox/Runtime/r3/posix/semeventmulti-posix.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/posix/semeventmulti-posix.cpp	(revision 25719)
+++ /trunk/src/VBox/Runtime/r3/posix/semeventmulti-posix.cpp	(revision 25720)
@@ -86,11 +86,19 @@
 
 
-RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI pEventMultiSem)
-{
+RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI phEventMultiSem)
+{
+    return RTSemEventMultiCreateEx(phEventMultiSem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, NULL);
+}
+
+
+RTDECL(int)  RTSemEventMultiCreateEx(PRTSEMEVENTMULTI phEventMultiSem, uint32_t fFlags, RTLOCKVALCLASS hClass,
+                                     const char *pszNameFmt, ...)
+{
+    AssertReturn(!(fFlags & ~RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER);
+
+    /*
+     * Allocate semaphore handle.
+     */
     int rc;
-
-    /*
-     * Allocate semaphore handle.
-     */
     struct RTSEMEVENTMULTIINTERNAL *pThis = (struct RTSEMEVENTMULTIINTERNAL *)RTMemAlloc(sizeof(struct RTSEMEVENTMULTIINTERNAL));
     if (pThis)
@@ -122,11 +130,14 @@
                         ASMAtomicXchgU32(&pThis->cWaiters, 0);
 #ifdef RTSEMEVENTMULTI_STRICT
-                        RTLockValidatorRecSharedInit(&pThis->Signallers,
-                                                     NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_ANY,
-                                                     pThis, true /*fSignaller*/, true /*fEnabled*/, "RTSemEvent");
+                        va_list va;
+                        va_start(va, pszNameFmt);
+                        RTLockValidatorRecSharedInitV(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis,
+                                                      true /*fSignaller*/, !(fFlags & RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL),
+                                                      pszNameFmt, va);
+                        va_end(va);
                         pThis->fEverHadSignallers = false;
 #endif
 
-                        *pEventMultiSem = pThis;
+                        *phEventMultiSem = pThis;
                         return VINF_SUCCESS;
                     }
@@ -150,10 +161,10 @@
 
 
-RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI EventMultiSem)
+RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI hEventMultiSem)
 {
     /*
      * Validate handle.
      */
-    struct RTSEMEVENTMULTIINTERNAL *pThis = EventMultiSem;
+    struct RTSEMEVENTMULTIINTERNAL *pThis = hEventMultiSem;
     if (pThis == NIL_RTSEMEVENTMULTI)
         return VINF_SUCCESS;
@@ -177,5 +188,5 @@
     if (rc)
     {
-        AssertMsgFailed(("Failed to destroy event sem %p, rc=%d.\n", EventMultiSem, rc));
+        AssertMsgFailed(("Failed to destroy event sem %p, rc=%d.\n", hEventMultiSem, rc));
         return RTErrConvertFromErrno(rc);
     }
@@ -194,5 +205,5 @@
     if (rc)
     {
-        AssertMsgFailed(("Failed to destroy event sem %p, rc=%d. (mutex)\n", EventMultiSem, rc));
+        AssertMsgFailed(("Failed to destroy event sem %p, rc=%d. (mutex)\n", hEventMultiSem, rc));
         return RTErrConvertFromErrno(rc);
     }
@@ -209,10 +220,10 @@
 
 
-RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI EventMultiSem)
+RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI hEventMultiSem)
 {
     /*
      * Validate input.
      */
-    struct RTSEMEVENTMULTIINTERNAL *pThis = EventMultiSem;
+    struct RTSEMEVENTMULTIINTERNAL *pThis = hEventMultiSem;
     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     uint32_t u32 = pThis->u32State;
@@ -234,5 +245,5 @@
     if (rc)
     {
-        AssertMsgFailed(("Failed to lock event sem %p, rc=%d.\n", EventMultiSem, rc));
+        AssertMsgFailed(("Failed to lock event sem %p, rc=%d.\n", hEventMultiSem, rc));
         return RTErrConvertFromErrno(rc);
     }
@@ -245,10 +256,10 @@
         ASMAtomicXchgU32(&pThis->u32State, EVENTMULTI_STATE_SIGNALED);
         rc = pthread_cond_broadcast(&pThis->Cond);
-        AssertMsg(!rc, ("Failed to signal event sem %p, rc=%d.\n", EventMultiSem, rc));
+        AssertMsg(!rc, ("Failed to signal event sem %p, rc=%d.\n", hEventMultiSem, rc));
     }
     else if (pThis->u32State == EVENTMULTI_STATE_SIGNALED)
     {
         rc = pthread_cond_broadcast(&pThis->Cond); /* give'm another kick... */
-        AssertMsg(!rc, ("Failed to signal event sem %p, rc=%d. (2)\n", EventMultiSem, rc));
+        AssertMsg(!rc, ("Failed to signal event sem %p, rc=%d. (2)\n", hEventMultiSem, rc));
     }
     else
@@ -259,5 +270,5 @@
      */
     int rc2 = pthread_mutex_unlock(&pThis->Mutex);
-    AssertMsg(!rc2, ("Failed to unlock event sem %p, rc=%d.\n", EventMultiSem, rc));
+    AssertMsg(!rc2, ("Failed to unlock event sem %p, rc=%d.\n", hEventMultiSem, rc));
     if (rc)
         return RTErrConvertFromErrno(rc);
@@ -269,10 +280,10 @@
 
 
-RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI EventMultiSem)
+RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI hEventMultiSem)
 {
     /*
      * Validate input.
      */
-    struct RTSEMEVENTMULTIINTERNAL *pThis = EventMultiSem;
+    struct RTSEMEVENTMULTIINTERNAL *pThis = hEventMultiSem;
     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     uint32_t u32 = pThis->u32State;
@@ -285,5 +296,5 @@
     if (rc)
     {
-        AssertMsgFailed(("Failed to lock event multi sem %p, rc=%d.\n", EventMultiSem, rc));
+        AssertMsgFailed(("Failed to lock event multi sem %p, rc=%d.\n", hEventMultiSem, rc));
         return RTErrConvertFromErrno(rc);
     }
@@ -303,5 +314,5 @@
     if (rc)
     {
-        AssertMsgFailed(("Failed to unlock event multi sem %p, rc=%d.\n", EventMultiSem, rc));
+        AssertMsgFailed(("Failed to unlock event multi sem %p, rc=%d.\n", hEventMultiSem, rc));
         return RTErrConvertFromErrno(rc);
     }
@@ -312,5 +323,5 @@
 
 
-static int rtSemEventMultiWait(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies, bool fAutoResume)
+static int rtSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies, bool fAutoResume)
 {
     PCRTLOCKVALSRCPOS pSrcPos = NULL;
@@ -319,5 +330,5 @@
      * Validate input.
      */
-    struct RTSEMEVENTMULTIINTERNAL *pThis = EventMultiSem;
+    struct RTSEMEVENTMULTIINTERNAL *pThis = hEventMultiSem;
     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     uint32_t u32 = pThis->u32State;
@@ -333,5 +344,5 @@
         if (rc)
         {
-            AssertMsgFailed(("Failed to lock event multi sem %p, rc=%d.\n", EventMultiSem, rc));
+            AssertMsgFailed(("Failed to lock event multi sem %p, rc=%d.\n", hEventMultiSem, rc));
             return RTErrConvertFromErrno(rc);
         }
@@ -345,5 +356,5 @@
                 ASMAtomicDecU32(&pThis->cWaiters);
                 rc = pthread_mutex_unlock(&pThis->Mutex);
-                AssertMsg(!rc, ("Failed to unlock event multi sem %p, rc=%d.\n", EventMultiSem, rc)); NOREF(rc);
+                AssertMsg(!rc, ("Failed to unlock event multi sem %p, rc=%d.\n", hEventMultiSem, rc)); NOREF(rc);
                 return VINF_SUCCESS;
             }
@@ -351,5 +362,5 @@
             {
                 rc = pthread_mutex_unlock(&pThis->Mutex);
-                AssertMsg(!rc, ("Failed to unlock event multi sem %p, rc=%d.\n", EventMultiSem, rc)); NOREF(rc);
+                AssertMsg(!rc, ("Failed to unlock event multi sem %p, rc=%d.\n", hEventMultiSem, rc)); NOREF(rc);
                 return VERR_SEM_DESTROYED;
             }
@@ -377,8 +388,8 @@
             if (rc)
             {
-                AssertMsgFailed(("Failed to wait on event multi sem %p, rc=%d.\n", EventMultiSem, rc));
+                AssertMsgFailed(("Failed to wait on event multi sem %p, rc=%d.\n", hEventMultiSem, rc));
                 ASMAtomicDecU32(&pThis->cWaiters);
                 int rc2 = pthread_mutex_unlock(&pThis->Mutex);
-                AssertMsg(!rc2, ("Failed to unlock event multi sem %p, rc=%d.\n", EventMultiSem, rc2)); NOREF(rc2);
+                AssertMsg(!rc2, ("Failed to unlock event multi sem %p, rc=%d.\n", hEventMultiSem, rc2)); NOREF(rc2);
                 return RTErrConvertFromErrno(rc);
             }
@@ -421,5 +432,5 @@
         if (rc)
         {
-            AssertMsg(rc == ETIMEDOUT, ("Failed to lock event multi sem %p, rc=%d.\n", EventMultiSem, rc));
+            AssertMsg(rc == ETIMEDOUT, ("Failed to lock event multi sem %p, rc=%d.\n", hEventMultiSem, rc));
             return RTErrConvertFromErrno(rc);
         }
@@ -433,5 +444,5 @@
                 ASMAtomicDecU32(&pThis->cWaiters);
                 rc = pthread_mutex_unlock(&pThis->Mutex);
-                AssertMsg(!rc, ("Failed to unlock event multi sem %p, rc=%d.\n", EventMultiSem, rc)); NOREF(rc);
+                AssertMsg(!rc, ("Failed to unlock event multi sem %p, rc=%d.\n", hEventMultiSem, rc)); NOREF(rc);
                 return VINF_SUCCESS;
             }
@@ -439,5 +450,5 @@
             {
                 rc = pthread_mutex_unlock(&pThis->Mutex);
-                AssertMsg(!rc, ("Failed to unlock event multi sem %p, rc=%d.\n", EventMultiSem, rc)); NOREF(rc);
+                AssertMsg(!rc, ("Failed to unlock event multi sem %p, rc=%d.\n", hEventMultiSem, rc)); NOREF(rc);
                 return VERR_SEM_DESTROYED;
             }
@@ -473,8 +484,8 @@
             if (rc && (rc != EINTR || !fAutoResume)) /* according to SuS this function shall not return EINTR, but linux man page says differently. */
             {
-                AssertMsg(rc == ETIMEDOUT, ("Failed to wait on event multi sem %p, rc=%d.\n", EventMultiSem, rc));
+                AssertMsg(rc == ETIMEDOUT, ("Failed to wait on event multi sem %p, rc=%d.\n", hEventMultiSem, rc));
                 ASMAtomicDecU32(&pThis->cWaiters);
                 int rc2 = pthread_mutex_unlock(&pThis->Mutex);
-                AssertMsg(!rc2, ("Failed to unlock event multi sem %p, rc=%d.\n", EventMultiSem, rc2)); NOREF(rc2);
+                AssertMsg(!rc2, ("Failed to unlock event multi sem %p, rc=%d.\n", hEventMultiSem, rc2)); NOREF(rc2);
                 return RTErrConvertFromErrno(rc);
             }
@@ -484,7 +495,7 @@
 
 
-RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
-{
-    int rc = rtSemEventMultiWait(EventMultiSem, cMillies, true);
+RTDECL(int)  RTSemEventMultiWait(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
+{
+    int rc = rtSemEventMultiWait(hEventMultiSem, cMillies, true);
     Assert(rc != VERR_INTERRUPTED);
     return rc;
@@ -492,7 +503,7 @@
 
 
-RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
-{
-    return rtSemEventMultiWait(EventMultiSem, cMillies, false);
+RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
+{
+    return rtSemEventMultiWait(hEventMultiSem, cMillies, false);
 }
 
Index: /trunk/src/VBox/Runtime/r3/win/semeventmulti-win.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/win/semeventmulti-win.cpp	(revision 25719)
+++ /trunk/src/VBox/Runtime/r3/win/semeventmulti-win.cpp	(revision 25720)
@@ -70,11 +70,16 @@
 
 
-/* Undefine debug mappings. */
-#undef RTSemEventMultiWait
-#undef RTSemEventMultiWaitNoResume
-
-
-RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI pEventMultiSem)
-{
+
+RTDECL(int)  RTSemEventMultiCreate(PRTSEMEVENTMULTI phEventMultiSem)
+{
+    return RTSemEventMultiCreateEx(phEventMultiSem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, NULL);
+}
+
+
+RTDECL(int)  RTSemEventMultiCreateEx(PRTSEMEVENTMULTI phEventMultiSem, uint32_t fFlags, RTLOCKVALCLASS hClass,
+                                     const char *pszNameFmt, ...)
+{
+    AssertReturn(!(fFlags & ~RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER);
+
     struct RTSEMEVENTMULTIINTERNAL *pThis = (struct RTSEMEVENTMULTIINTERNAL *)RTMemAlloc(sizeof(*pThis));
     if (!pThis)
@@ -90,11 +95,14 @@
         pThis->u32Magic = RTSEMEVENTMULTI_MAGIC;
 #ifdef RTSEMEVENT_STRICT
-        RTLockValidatorRecSharedInit(&pThis->Signallers,
-                                     NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_ANY,
-                                     pThis, true /*fSignaller*/, true /*fEnabled*/, "RTSemEvent");
+        va_list va;
+        va_start(va, pszNameFmt);
+        RTLockValidatorRecSharedInitV(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis,
+                                      true /*fSignaller*/, !(fFlags & RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL),
+                                      pszNameFmt, va);
+        va_end(va);
         pThis->fEverHadSignallers = false;
 #endif
 
-        *pEventMultiSem = pThis;
+        *phEventMultiSem = pThis;
         return VINF_SUCCESS;
     }
@@ -106,9 +114,9 @@
 
 
-RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI EventMultiSem)
-{
-    struct RTSEMEVENTMULTIINTERNAL *pThis = EventMultiSem;
+RTDECL(int)  RTSemEventMultiDestroy(RTSEMEVENTMULTI hEventMultiSem)
+{
+    struct RTSEMEVENTMULTIINTERNAL *pThis = hEventMultiSem;
     if (pThis == NIL_RTSEMEVENT)        /* don't bitch */
-        return VERR_INVALID_HANDLE;
+        return VINF_SUCCESS;
     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     AssertReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, VERR_INVALID_HANDLE);
@@ -130,5 +138,5 @@
         DWORD dwErr = GetLastError();
         rc = RTErrConvertFromWin32(dwErr);
-        AssertMsgFailed(("Destroy EventMultiSem %p failed, lasterr=%u (%Rrc)\n", pThis, dwErr, rc));
+        AssertMsgFailed(("Destroy hEventMultiSem %p failed, lasterr=%u (%Rrc)\n", pThis, dwErr, rc));
         /* Leak it. */
     }
@@ -138,10 +146,10 @@
 
 
-RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI EventMultiSem)
+RTDECL(int)  RTSemEventMultiSignal(RTSEMEVENTMULTI hEventMultiSem)
 {
     /*
      * Validate input.
      */
-    struct RTSEMEVENTMULTIINTERNAL *pThis = EventMultiSem;
+    struct RTSEMEVENTMULTIINTERNAL *pThis = hEventMultiSem;
     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     AssertReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, VERR_INVALID_HANDLE);
@@ -162,15 +170,15 @@
         return VINF_SUCCESS;
     DWORD dwErr = GetLastError();
-    AssertMsgFailed(("Signaling EventMultiSem %p failed, lasterr=%d\n", pThis, dwErr));
+    AssertMsgFailed(("Signaling hEventMultiSem %p failed, lasterr=%d\n", pThis, dwErr));
     return RTErrConvertFromWin32(dwErr);
 }
 
 
-RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI EventMultiSem)
+RTDECL(int)  RTSemEventMultiReset(RTSEMEVENTMULTI hEventMultiSem)
 {
     /*
      * Validate input.
      */
-    struct RTSEMEVENTMULTIINTERNAL *pThis = EventMultiSem;
+    struct RTSEMEVENTMULTIINTERNAL *pThis = hEventMultiSem;
     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     AssertReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, VERR_INVALID_HANDLE);
@@ -182,5 +190,5 @@
         return VINF_SUCCESS;
     DWORD dwErr = GetLastError();
-    AssertMsgFailed(("Resetting EventMultiSem %p failed, lasterr=%d\n", pThis, dwErr));
+    AssertMsgFailed(("Resetting hEventMultiSem %p failed, lasterr=%d\n", pThis, dwErr));
     return RTErrConvertFromWin32(dwErr);
 }
@@ -201,5 +209,5 @@
         {
             int rc2 = RTErrConvertFromWin32(GetLastError());
-            AssertMsgFailed(("Wait on EventMultiSem %p failed, rc=%d lasterr=%d\n", pThis, rc, GetLastError()));
+            AssertMsgFailed(("Wait on hEventMultiSem %p failed, rc=%d lasterr=%d\n", pThis, rc, GetLastError()));
             if (rc2)
                 return rc2;
@@ -212,5 +220,6 @@
 
 
-RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI EventMultiSem, unsigned cMillies)
+#undef RTSemEventMultiWaitNoResume
+RTDECL(int)  RTSemEventMultiWaitNoResume(RTSEMEVENTMULTI hEventMultiSem, unsigned cMillies)
 {
     PCRTLOCKVALSRCPOS pSrcPos = NULL;
@@ -219,5 +228,5 @@
      * Validate input.
      */
-    struct RTSEMEVENTMULTIINTERNAL *pThis = EventMultiSem;
+    struct RTSEMEVENTMULTIINTERNAL *pThis = hEventMultiSem;
     AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
     AssertReturn(pThis->u32Magic == RTSEMEVENTMULTI_MAGIC, VERR_INVALID_HANDLE);
