Index: trunk/src/VBox/Runtime/r3/linux/semevent-linux.cpp
===================================================================
--- trunk/src/VBox/Runtime/r3/linux/semevent-linux.cpp	(revision 6746)
+++ trunk/src/VBox/Runtime/r3/linux/semevent-linux.cpp	(revision 6747)
@@ -90,10 +90,10 @@
      * Allocate semaphore handle.
      */
-    struct RTSEMEVENTINTERNAL *pIntEventSem = (struct RTSEMEVENTINTERNAL *)RTMemAlloc(sizeof(struct RTSEMEVENTINTERNAL));
-    if (pIntEventSem)
-    {
-        pIntEventSem->iMagic = RTSEMEVENT_MAGIC;
-        pIntEventSem->cWaiters = 0;
-        *pEventSem = pIntEventSem;
+    struct RTSEMEVENTINTERNAL *pThis = (struct RTSEMEVENTINTERNAL *)RTMemAlloc(sizeof(struct RTSEMEVENTINTERNAL));
+    if (pThis)
+    {
+        pThis->iMagic = RTSEMEVENT_MAGIC;
+        pThis->cWaiters = 0;
+        *pEventSem = pThis;
         return VINF_SUCCESS;
     }
@@ -107,6 +107,6 @@
      * Validate input.
      */
-    struct RTSEMEVENTINTERNAL *pIntEventSem = EventSem;
-    AssertReturn(VALID_PTR(pIntEventSem) && pIntEventSem->iMagic == RTSEMEVENT_MAGIC,
+    struct RTSEMEVENTINTERNAL *pThis = EventSem;
+    AssertReturn(VALID_PTR(pThis) && pThis->iMagic == RTSEMEVENT_MAGIC,
                  VERR_INVALID_HANDLE);
 
@@ -114,8 +114,8 @@
      * Invalidate the semaphore and wake up anyone waiting on it.
      */
-    ASMAtomicXchgSize(&pIntEventSem->iMagic, RTSEMEVENT_MAGIC + 1);
-    if (ASMAtomicXchgS32(&pIntEventSem->cWaiters, INT32_MIN / 2) > 0)
-    {
-        sys_futex(&pIntEventSem->cWaiters, FUTEX_WAKE, INT_MAX, NULL, NULL, 0);
+    ASMAtomicXchgSize(&pThis->iMagic, RTSEMEVENT_MAGIC + 1);
+    if (ASMAtomicXchgS32(&pThis->cWaiters, INT32_MIN / 2) > 0)
+    {
+        sys_futex(&pThis->cWaiters, FUTEX_WAKE, INT_MAX, NULL, NULL, 0);
         usleep(1000);
     }
@@ -124,5 +124,5 @@
      * Free the semaphore memory and be gone.
      */
-    RTMemFree(pIntEventSem);
+    RTMemFree(pThis);
     return VINF_SUCCESS;
 }
@@ -134,6 +134,6 @@
      * Validate input.
      */
-    struct RTSEMEVENTINTERNAL *pIntEventSem = EventSem;
-    AssertReturn(VALID_PTR(pIntEventSem) && pIntEventSem->iMagic == RTSEMEVENT_MAGIC,
+    struct RTSEMEVENTINTERNAL *pThis = EventSem;
+    AssertReturn(VALID_PTR(pThis) && pThis->iMagic == RTSEMEVENT_MAGIC,
                  VERR_INVALID_HANDLE);
     /*
@@ -142,8 +142,8 @@
     for (unsigned i = 0;; i++)
     {
-        int32_t iCur = pIntEventSem->cWaiters;
+        int32_t iCur = pThis->cWaiters;
         if (iCur == 0)
         {
-            if (ASMAtomicCmpXchgS32(&pIntEventSem->cWaiters, -1, 0))
+            if (ASMAtomicCmpXchgS32(&pThis->cWaiters, -1, 0))
                 break; /* nobody is waiting */
         }
@@ -153,8 +153,8 @@
         {
             /* somebody is waiting, try wake up one of them. */
-            long cWoken = sys_futex(&pIntEventSem->cWaiters, FUTEX_WAKE, 1, NULL, NULL, 0);
+            long cWoken = sys_futex(&pThis->cWaiters, FUTEX_WAKE, 1, NULL, NULL, 0);
             if (RT_LIKELY(cWoken == 1))
             {
-                ASMAtomicDecS32(&pIntEventSem->cWaiters);
+                ASMAtomicDecS32(&pThis->cWaiters);
                 break;
             }
@@ -180,5 +180,5 @@
                     pthread_yield();
                 else
-                    AssertReleaseMsg(i < 4096, ("iCur=%#x pIntEventSem=%p\n", iCur, pIntEventSem));
+                    AssertReleaseMsg(i < 4096, ("iCur=%#x pThis=%p\n", iCur, pThis));
             }
         }
@@ -193,6 +193,6 @@
      * Validate input.
      */
-    struct RTSEMEVENTINTERNAL *pIntEventSem = EventSem;
-    AssertReturn(VALID_PTR(pIntEventSem) && pIntEventSem->iMagic == RTSEMEVENT_MAGIC,
+    struct RTSEMEVENTINTERNAL *pThis = EventSem;
+    AssertReturn(VALID_PTR(pThis) && pThis->iMagic == RTSEMEVENT_MAGIC,
                  VERR_INVALID_HANDLE);
 
@@ -200,5 +200,5 @@
      * Quickly check whether it's signaled.
      */
-    if (ASMAtomicCmpXchgS32(&pIntEventSem->cWaiters, 0, -1))
+    if (ASMAtomicCmpXchgS32(&pThis->cWaiters, 0, -1))
         return VINF_SUCCESS;
 
@@ -223,5 +223,5 @@
          * Announce that we're among the waiters.
          */
-        int32_t iNew = ASMAtomicIncS32(&pIntEventSem->cWaiters);
+        int32_t iNew = ASMAtomicIncS32(&pThis->cWaiters);
         if (iNew == 0)
             return VINF_SUCCESS;
@@ -231,6 +231,6 @@
              * Go to sleep.
              */
-            long rc = sys_futex(&pIntEventSem->cWaiters, FUTEX_WAIT, iNew, pTimeout, NULL, 0);
-            if (RT_UNLIKELY(pIntEventSem->iMagic != RTSEMEVENT_MAGIC))
+            long rc = sys_futex(&pThis->cWaiters, FUTEX_WAIT, iNew, pTimeout, NULL, 0);
+            if (RT_UNLIKELY(pThis->iMagic != RTSEMEVENT_MAGIC))
                 return VERR_SEM_DESTROYED;
 
@@ -240,5 +240,5 @@
 
             /* No, then the kernel woke us up or we failed going to sleep. Adjust the accounting. */
-            iNew = ASMAtomicDecS32(&pIntEventSem->cWaiters);
+            iNew = ASMAtomicDecS32(&pThis->cWaiters);
             Assert(iNew >= 0);
 
@@ -268,5 +268,5 @@
         {
             /* this can't happen. */
-            if (RT_UNLIKELY(pIntEventSem->iMagic != RTSEMEVENT_MAGIC))
+            if (RT_UNLIKELY(pThis->iMagic != RTSEMEVENT_MAGIC))
                 return VERR_SEM_DESTROYED;
             AssertReleaseMsgFailed(("iNew=%d\n", iNew));
Index: trunk/src/VBox/Runtime/r3/linux/semeventmulti-linux.cpp
===================================================================
--- trunk/src/VBox/Runtime/r3/linux/semeventmulti-linux.cpp	(revision 6746)
+++ trunk/src/VBox/Runtime/r3/linux/semeventmulti-linux.cpp	(revision 6747)
@@ -89,10 +89,10 @@
      * Allocate semaphore handle.
      */
-    struct RTSEMEVENTMULTIINTERNAL *pIntEventMultiSem = (struct RTSEMEVENTMULTIINTERNAL *)RTMemAlloc(sizeof(struct RTSEMEVENTMULTIINTERNAL));
-    if (pIntEventMultiSem)
-    {
-        pIntEventMultiSem->iMagic = RTSEMEVENTMULTI_MAGIC;
-        pIntEventMultiSem->iState = 0;
-        *pEventMultiSem = pIntEventMultiSem;
+    struct RTSEMEVENTMULTIINTERNAL *pThis = (struct RTSEMEVENTMULTIINTERNAL *)RTMemAlloc(sizeof(struct RTSEMEVENTMULTIINTERNAL));
+    if (pThis)
+    {
+        pThis->iMagic = RTSEMEVENTMULTI_MAGIC;
+        pThis->iState = 0;
+        *pEventMultiSem = pThis;
         return VINF_SUCCESS;
     }
@@ -106,6 +106,6 @@
      * Validate input.
      */
-    struct RTSEMEVENTMULTIINTERNAL *pIntEventMultiSem = EventMultiSem;
-    AssertReturn(VALID_PTR(pIntEventMultiSem) && pIntEventMultiSem->iMagic == RTSEMEVENTMULTI_MAGIC,
+    struct RTSEMEVENTMULTIINTERNAL *pThis = EventMultiSem;
+    AssertReturn(VALID_PTR(pThis) && pThis->iMagic == RTSEMEVENTMULTI_MAGIC,
                  VERR_INVALID_HANDLE);
 
@@ -113,8 +113,8 @@
      * Invalidate the semaphore and wake up anyone waiting on it.
      */
-    ASMAtomicXchgSize(&pIntEventMultiSem->iMagic, RTSEMEVENTMULTI_MAGIC + 1);
-    if (ASMAtomicXchgS32(&pIntEventMultiSem->iState, -1) == 1)
-    {
-        sys_futex(&pIntEventMultiSem->iState, FUTEX_WAKE, INT_MAX, NULL, NULL, 0);
+    ASMAtomicXchgSize(&pThis->iMagic, RTSEMEVENTMULTI_MAGIC + 1);
+    if (ASMAtomicXchgS32(&pThis->iState, -1) == 1)
+    {
+        sys_futex(&pThis->iState, FUTEX_WAKE, INT_MAX, NULL, NULL, 0);
         usleep(1000);
     }
@@ -123,5 +123,5 @@
      * Free the semaphore memory and be gone.
      */
-    RTMemFree(pIntEventMultiSem);
+    RTMemFree(pThis);
     return VINF_SUCCESS;
 }
@@ -133,15 +133,15 @@
      * Validate input.
      */
-    struct RTSEMEVENTMULTIINTERNAL *pIntEventMultiSem = EventMultiSem;
-    AssertReturn(VALID_PTR(pIntEventMultiSem) && pIntEventMultiSem->iMagic == RTSEMEVENTMULTI_MAGIC,
+    struct RTSEMEVENTMULTIINTERNAL *pThis = EventMultiSem;
+    AssertReturn(VALID_PTR(pThis) && pThis->iMagic == RTSEMEVENTMULTI_MAGIC,
                  VERR_INVALID_HANDLE);
     /*
      * Signal it.
      */
-    int32_t iOld = ASMAtomicXchgS32(&pIntEventMultiSem->iState, -1);
+    int32_t iOld = ASMAtomicXchgS32(&pThis->iState, -1);
     if (iOld > 0)
     {
         /* wake up sleeping threads. */
-        long cWoken = sys_futex(&pIntEventMultiSem->iState, FUTEX_WAKE, INT_MAX, NULL, NULL, 0);
+        long cWoken = sys_futex(&pThis->iState, FUTEX_WAKE, INT_MAX, NULL, NULL, 0);
         AssertMsg(cWoken >= 0, ("%ld\n", cWoken)); NOREF(cWoken);
     }
@@ -156,9 +156,9 @@
      * Validate input.
      */
-    struct RTSEMEVENTMULTIINTERNAL *pIntEventMultiSem = EventMultiSem;
-    AssertReturn(VALID_PTR(pIntEventMultiSem) && pIntEventMultiSem->iMagic == RTSEMEVENTMULTI_MAGIC,
+    struct RTSEMEVENTMULTIINTERNAL *pThis = EventMultiSem;
+    AssertReturn(VALID_PTR(pThis) && pThis->iMagic == RTSEMEVENTMULTI_MAGIC,
                  VERR_INVALID_HANDLE);
 #ifdef RT_STRICT
-    int32_t i = pIntEventMultiSem->iState;
+    int32_t i = pThis->iState;
     Assert(i == 0 || i == -1 || i == 1);
 #endif
@@ -167,5 +167,5 @@
      * Reset it.
      */
-    ASMAtomicCmpXchgS32(&pIntEventMultiSem->iState, 0, -1);
+    ASMAtomicCmpXchgS32(&pThis->iState, 0, -1);
     return VINF_SUCCESS;
 }
@@ -177,6 +177,6 @@
      * Validate input.
      */
-    struct RTSEMEVENTMULTIINTERNAL *pIntEventMultiSem = EventMultiSem;
-    AssertReturn(VALID_PTR(pIntEventMultiSem) && pIntEventMultiSem->iMagic == RTSEMEVENTMULTI_MAGIC,
+    struct RTSEMEVENTMULTIINTERNAL *pThis = EventMultiSem;
+    AssertReturn(VALID_PTR(pThis) && pThis->iMagic == RTSEMEVENTMULTI_MAGIC,
                  VERR_INVALID_HANDLE);
 
@@ -184,5 +184,5 @@
      * Quickly check whether it's signaled.
      */
-    int32_t iCur = pIntEventMultiSem->iState;
+    int32_t iCur = pThis->iState;
     Assert(iCur == 0 || iCur == -1 || iCur == 1);
     if (iCur == -1)
@@ -212,11 +212,11 @@
          * threads waiting on the semaphore to keep things simple.
          */
-        iCur = pIntEventMultiSem->iState;
+        iCur = pThis->iState;
         Assert(iCur == 0 || iCur == -1 || iCur == 1);
         if (    iCur == 1
-            ||  ASMAtomicCmpXchgS32(&pIntEventMultiSem->iState, 1, 0))
+            ||  ASMAtomicCmpXchgS32(&pThis->iState, 1, 0))
         {
-            long rc = sys_futex(&pIntEventMultiSem->iState, FUTEX_WAIT, 1, pTimeout, NULL, 0);
-            if (RT_UNLIKELY(pIntEventMultiSem->iMagic != RTSEMEVENTMULTI_MAGIC))
+            long rc = sys_futex(&pThis->iState, FUTEX_WAIT, 1, pTimeout, NULL, 0);
+            if (RT_UNLIKELY(pThis->iMagic != RTSEMEVENTMULTI_MAGIC))
                 return VERR_SEM_DESTROYED;
             if (rc == 0)
Index: trunk/src/VBox/Runtime/r3/linux/semmutex-linux.cpp
===================================================================
--- trunk/src/VBox/Runtime/r3/linux/semmutex-linux.cpp	(revision 6746)
+++ trunk/src/VBox/Runtime/r3/linux/semmutex-linux.cpp	(revision 6747)
@@ -93,13 +93,13 @@
      * Allocate semaphore handle.
      */
-    struct RTSEMMUTEXINTERNAL *pIntMutexSem = (struct RTSEMMUTEXINTERNAL *)RTMemAlloc(sizeof(struct RTSEMMUTEXINTERNAL));
-    if (pIntMutexSem)
-    {
-        pIntMutexSem->iMagic   = RTSEMMUTEX_MAGIC;
-        pIntMutexSem->iState   = 0;
-        pIntMutexSem->Owner    = (pthread_t)~0;
-        pIntMutexSem->cNesting = 0;
-
-        *pMutexSem = pIntMutexSem;
+    struct RTSEMMUTEXINTERNAL *pThis = (struct RTSEMMUTEXINTERNAL *)RTMemAlloc(sizeof(struct RTSEMMUTEXINTERNAL));
+    if (pThis)
+    {
+        pThis->iMagic   = RTSEMMUTEX_MAGIC;
+        pThis->iState   = 0;
+        pThis->Owner    = (pthread_t)~0;
+        pThis->cNesting = 0;
+
+        *pMutexSem = pThis;
         return VINF_SUCCESS;
     }
@@ -116,8 +116,8 @@
     if (MutexSem == NIL_RTSEMMUTEX)
         return VERR_INVALID_HANDLE;
-    struct RTSEMMUTEXINTERNAL *pIntMutexSem = MutexSem;
-    AssertPtrReturn(pIntMutexSem, VERR_INVALID_HANDLE);
-    AssertMsgReturn(pIntMutexSem->iMagic == RTSEMMUTEX_MAGIC,
-                    ("MutexSem=%p iMagic=%#x\n", pIntMutexSem, pIntMutexSem->iMagic),
+    struct RTSEMMUTEXINTERNAL *pThis = MutexSem;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->iMagic == RTSEMMUTEX_MAGIC,
+                    ("MutexSem=%p iMagic=%#x\n", pThis, pThis->iMagic),
                     VERR_INVALID_HANDLE);
 
@@ -125,17 +125,17 @@
      * Invalidate the semaphore and wake up anyone waiting on it.
      */
-    ASMAtomicXchgSize(&pIntMutexSem->iMagic, RTSEMMUTEX_MAGIC + 1);
-    if (ASMAtomicXchgS32(&pIntMutexSem->iState, 0) > 0)
-    {
-        sys_futex(&pIntMutexSem->iState, FUTEX_WAKE, INT_MAX, NULL, NULL, 0);
+    ASMAtomicXchgSize(&pThis->iMagic, RTSEMMUTEX_MAGIC + 1);
+    if (ASMAtomicXchgS32(&pThis->iState, 0) > 0)
+    {
+        sys_futex(&pThis->iState, FUTEX_WAKE, INT_MAX, NULL, NULL, 0);
         usleep(1000);
     }
-    pIntMutexSem->Owner    = (pthread_t)~0;
-    pIntMutexSem->cNesting = 0;
+    pThis->Owner    = (pthread_t)~0;
+    pThis->cNesting = 0;
 
     /*
      * Free the semaphore memory and be gone.
      */
-    RTMemFree(pIntMutexSem);
+    RTMemFree(pThis);
     return VINF_SUCCESS;
 }
@@ -147,8 +147,8 @@
      * Validate input.
      */
-    struct RTSEMMUTEXINTERNAL *pIntMutexSem = MutexSem;
-    AssertPtrReturn(pIntMutexSem, VERR_INVALID_HANDLE);
-    AssertMsgReturn(pIntMutexSem->iMagic == RTSEMMUTEX_MAGIC,
-                    ("MutexSem=%p iMagic=%#x\n", pIntMutexSem, pIntMutexSem->iMagic),
+    struct RTSEMMUTEXINTERNAL *pThis = MutexSem;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->iMagic == RTSEMMUTEX_MAGIC,
+                    ("MutexSem=%p iMagic=%#x\n", pThis, pThis->iMagic),
                     VERR_INVALID_HANDLE);
 
@@ -157,8 +157,8 @@
      */
     pthread_t Self = pthread_self();
-    if (    pIntMutexSem->Owner == Self
-        &&  pIntMutexSem->cNesting > 0)
-    {
-        pIntMutexSem->cNesting++;
+    if (    pThis->Owner == Self
+        &&  pThis->cNesting > 0)
+    {
+        pThis->cNesting++;
         return VINF_SUCCESS;
     }
@@ -179,9 +179,9 @@
      * Lock the mutex.
      */
-    if (RT_UNLIKELY(!ASMAtomicCmpXchgS32(&pIntMutexSem->iState, 1, 0)))
+    if (RT_UNLIKELY(!ASMAtomicCmpXchgS32(&pThis->iState, 1, 0)))
     {
         for (;;)
         {
-            int32_t iOld = ASMAtomicXchgS32(&pIntMutexSem->iState, 2);
+            int32_t iOld = ASMAtomicXchgS32(&pThis->iState, 2);
 
             /*
@@ -194,6 +194,6 @@
              * Go to sleep.
              */
-            long rc = sys_futex(&pIntMutexSem->iState, FUTEX_WAIT, 2, pTimeout, NULL, 0);
-            if (RT_UNLIKELY(pIntMutexSem->iMagic != RTSEMMUTEX_MAGIC))
+            long rc = sys_futex(&pThis->iState, FUTEX_WAIT, 2, pTimeout, NULL, 0);
+            if (RT_UNLIKELY(pThis->iMagic != RTSEMMUTEX_MAGIC))
                 return VERR_SEM_DESTROYED;
 
@@ -236,6 +236,6 @@
      * Set the owner and nesting.
      */
-    pIntMutexSem->Owner = Self;
-    ASMAtomicXchgU32(&pIntMutexSem->cNesting, 1);
+    pThis->Owner = Self;
+    ASMAtomicXchgU32(&pThis->cNesting, 1);
     return VINF_SUCCESS;
 }
@@ -261,8 +261,8 @@
      * Validate input.
      */
-    struct RTSEMMUTEXINTERNAL *pIntMutexSem = MutexSem;
-    AssertPtrReturn(pIntMutexSem, VERR_INVALID_HANDLE);
-    AssertMsgReturn(pIntMutexSem->iMagic == RTSEMMUTEX_MAGIC,
-                    ("MutexSem=%p iMagic=%#x\n", pIntMutexSem, pIntMutexSem->iMagic),
+    struct RTSEMMUTEXINTERNAL *pThis = MutexSem;
+    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
+    AssertMsgReturn(pThis->iMagic == RTSEMMUTEX_MAGIC,
+                    ("MutexSem=%p iMagic=%#x\n", pThis, pThis->iMagic),
                     VERR_INVALID_HANDLE);
 
@@ -271,9 +271,9 @@
      */
     pthread_t Self = pthread_self();
-    if (RT_UNLIKELY(    pIntMutexSem->Owner != Self
-                    ||  pIntMutexSem->cNesting == 0))
+    if (RT_UNLIKELY(    pThis->Owner != Self
+                    ||  pThis->cNesting == 0))
     {
         AssertMsgFailed(("Not owner of mutex %p!! Self=%08x Owner=%08x cNesting=%d\n",
-                         pIntMutexSem, Self, pIntMutexSem->Owner, pIntMutexSem->cNesting));
+                         pThis, Self, pThis->Owner, pThis->cNesting));
         return VERR_NOT_OWNER;
     }
@@ -282,7 +282,7 @@
      * If nested we'll just pop a nesting.
      */
-    if (pIntMutexSem->cNesting > 1)
-    {
-        pIntMutexSem->cNesting--;
+    if (pThis->cNesting > 1)
+    {
+        pThis->cNesting--;
         return VINF_SUCCESS;
     }
@@ -291,16 +291,16 @@
      * Clear the state. (cNesting == 1)
      */
-    pIntMutexSem->Owner = (pthread_t)~0;
-    ASMAtomicXchgU32(&pIntMutexSem->cNesting, 0);
+    pThis->Owner = (pthread_t)~0;
+    ASMAtomicXchgU32(&pThis->cNesting, 0);
 
     /*
      * Release the mutex.
      */
-    int32_t iNew = ASMAtomicDecS32(&pIntMutexSem->iState);
+    int32_t iNew = ASMAtomicDecS32(&pThis->iState);
     if (iNew != 0)
     {
         /* somebody is waiting, try wake up one of them. */
-        ASMAtomicXchgS32(&pIntMutexSem->iState, 0);
-        (void)sys_futex(&pIntMutexSem->iState, FUTEX_WAKE, 1, NULL, NULL, 0);
+        ASMAtomicXchgS32(&pThis->iState, 0);
+        (void)sys_futex(&pThis->iState, FUTEX_WAKE, 1, NULL, NULL, 0);
     }
     return VINF_SUCCESS;
