Index: trunk/src/VBox/Runtime/r3/posix/sched-posix.cpp
===================================================================
--- trunk/src/VBox/Runtime/r3/posix/sched-posix.cpp	(revision 61750)
+++ trunk/src/VBox/Runtime/r3/posix/sched-posix.cpp	(revision 61751)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2015 Oracle Corporation
+ * Copyright (C) 2006-2016 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -394,4 +394,5 @@
                 if (!rc)
                 {
+                    pthread_attr_destroy(&ThreadAttr);
                     /*
                      * Wait for the thread to finish.
Index: trunk/src/VBox/Runtime/r3/posix/semevent-posix.cpp
===================================================================
--- trunk/src/VBox/Runtime/r3/posix/semevent-posix.cpp	(revision 61750)
+++ trunk/src/VBox/Runtime/r3/posix/semevent-posix.cpp	(revision 61751)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2015 Oracle Corporation
+ * Copyright (C) 2006-2016 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -121,56 +121,40 @@
          * Create the condition variable.
          */
-        pthread_condattr_t CondAttr;
-        rc = pthread_condattr_init(&CondAttr);
+        rc = pthread_cond_init(&pThis->Cond, NULL);
         if (!rc)
         {
-            rc = pthread_cond_init(&pThis->Cond, &CondAttr);
+            /*
+             * Create the semaphore.
+             */
+            rc = pthread_mutex_init(&pThis->Mutex, NULL);
             if (!rc)
             {
-                /*
-                 * Create the semaphore.
-                 */
-                pthread_mutexattr_t MutexAttr;
-                rc = pthread_mutexattr_init(&MutexAttr);
-                if (!rc)
+                ASMAtomicWriteU32(&pThis->u32State, EVENT_STATE_NOT_SIGNALED);
+                ASMAtomicWriteU32(&pThis->cWaiters, 0);
+                pThis->fFlags = fFlags;
+#ifdef RTSEMEVENT_STRICT
+                if (!pszNameFmt)
                 {
-                    rc = pthread_mutex_init(&pThis->Mutex, &MutexAttr);
-                    if (!rc)
-                    {
-                        pthread_mutexattr_destroy(&MutexAttr);
-                        pthread_condattr_destroy(&CondAttr);
-
-                        ASMAtomicWriteU32(&pThis->u32State, EVENT_STATE_NOT_SIGNALED);
-                        ASMAtomicWriteU32(&pThis->cWaiters, 0);
-                        pThis->fFlags = fFlags;
-#ifdef RTSEMEVENT_STRICT
-                        if (!pszNameFmt)
-                        {
-                            static uint32_t volatile s_iSemEventAnon = 0;
-                            RTLockValidatorRecSharedInit(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis,
-                                                         true /*fSignaller*/, !(fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL),
-                                                         "RTSemEvent-%u", ASMAtomicIncU32(&s_iSemEventAnon) - 1);
-                        }
-                        else
-                        {
-                            va_list va;
-                            va_start(va, pszNameFmt);
-                            RTLockValidatorRecSharedInitV(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis,
-                                                          true /*fSignaller*/, !(fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL),
-                                                          pszNameFmt, va);
-                            va_end(va);
-                        }
-                        pThis->fEverHadSignallers = false;
-#endif
-
-                        *phEventSem = pThis;
-                        return VINF_SUCCESS;
-                    }
-
-                    pthread_mutexattr_destroy(&MutexAttr);
+                    static uint32_t volatile s_iSemEventAnon = 0;
+                    RTLockValidatorRecSharedInit(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis,
+                                                 true /*fSignaller*/, !(fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL),
+                                                 "RTSemEvent-%u", ASMAtomicIncU32(&s_iSemEventAnon) - 1);
                 }
-                pthread_cond_destroy(&pThis->Cond);
-            }
-            pthread_condattr_destroy(&CondAttr);
+                else
+                {
+                    va_list va;
+                    va_start(va, pszNameFmt);
+                    RTLockValidatorRecSharedInitV(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis,
+                                                  true /*fSignaller*/, !(fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL),
+                                                  pszNameFmt, va);
+                    va_end(va);
+                }
+                pThis->fEverHadSignallers = false;
+#endif
+
+                *phEventSem = pThis;
+                return VINF_SUCCESS;
+            }
+            pthread_cond_destroy(&pThis->Cond);
         }
 
Index: trunk/src/VBox/Runtime/r3/posix/semeventmulti-posix.cpp
===================================================================
--- trunk/src/VBox/Runtime/r3/posix/semeventmulti-posix.cpp	(revision 61750)
+++ trunk/src/VBox/Runtime/r3/posix/semeventmulti-posix.cpp	(revision 61751)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2015 Oracle Corporation
+ * Copyright (C) 2006-2016 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -142,42 +142,35 @@
                  * Create the semaphore.
                  */
-                pthread_mutexattr_t MutexAttr;
-                rc = pthread_mutexattr_init(&MutexAttr);
+                rc = pthread_mutex_init(&pThis->Mutex, NULL);
                 if (!rc)
                 {
-                    rc = pthread_mutex_init(&pThis->Mutex, &MutexAttr);
-                    if (!rc)
+                    pthread_condattr_destroy(&CondAttr);
+
+                    ASMAtomicXchgU32(&pThis->u32State, EVENTMULTI_STATE_NOT_SIGNALED);
+                    ASMAtomicXchgU32(&pThis->cWaiters, 0);
+#ifdef RTSEMEVENTMULTI_STRICT
+                    if (!pszNameFmt)
                     {
-                        pthread_mutexattr_destroy(&MutexAttr);
-                        pthread_condattr_destroy(&CondAttr);
-
-                        ASMAtomicXchgU32(&pThis->u32State, EVENTMULTI_STATE_NOT_SIGNALED);
-                        ASMAtomicXchgU32(&pThis->cWaiters, 0);
-#ifdef RTSEMEVENTMULTI_STRICT
-                        if (!pszNameFmt)
-                        {
-                            static uint32_t volatile s_iSemEventMultiAnon = 0;
-                            RTLockValidatorRecSharedInit(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis,
-                                                         true /*fSignaller*/, !(fFlags & RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL),
-                                                         "RTSemEventMulti-%u", ASMAtomicIncU32(&s_iSemEventMultiAnon) - 1);
-                        }
-                        else
-                        {
-                            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
-
-                        *phEventMultiSem = pThis;
-                        return VINF_SUCCESS;
+                        static uint32_t volatile s_iSemEventMultiAnon = 0;
+                        RTLockValidatorRecSharedInit(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis,
+                                                     true /*fSignaller*/, !(fFlags & RTSEMEVENTMULTI_FLAGS_NO_LOCK_VAL),
+                                                     "RTSemEventMulti-%u", ASMAtomicIncU32(&s_iSemEventMultiAnon) - 1);
                     }
-
-                    pthread_mutexattr_destroy(&MutexAttr);
+                    else
+                    {
+                        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
+
+                    *phEventMultiSem = pThis;
+                    return VINF_SUCCESS;
                 }
+
                 pthread_cond_destroy(&pThis->Cond);
             }
Index: trunk/src/VBox/Runtime/r3/posix/semmutex-posix.cpp
===================================================================
--- trunk/src/VBox/Runtime/r3/posix/semmutex-posix.cpp	(revision 61750)
+++ trunk/src/VBox/Runtime/r3/posix/semmutex-posix.cpp	(revision 61751)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2015 Oracle Corporation
+ * Copyright (C) 2006-2016 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -127,38 +127,30 @@
          * Create the semaphore.
          */
-        pthread_mutexattr_t MutexAttr;
-        rc = pthread_mutexattr_init(&MutexAttr);
+        rc = pthread_mutex_init(&pThis->Mutex, NULL);
         if (!rc)
         {
-            rc = pthread_mutex_init(&pThis->Mutex, &MutexAttr);
-            if (!rc)
+            pThis->Owner    = (pthread_t)-1;
+            pThis->cNesting = 0;
+            pThis->u32Magic = RTSEMMUTEX_MAGIC;
+#ifdef RTSEMMUTEX_STRICT
+            if (!pszNameFmt)
             {
-                pthread_mutexattr_destroy(&MutexAttr);
-
-                pThis->Owner    = (pthread_t)-1;
-                pThis->cNesting = 0;
-                pThis->u32Magic = RTSEMMUTEX_MAGIC;
-#ifdef RTSEMMUTEX_STRICT
-                if (!pszNameFmt)
-                {
-                    static uint32_t volatile s_iMutexAnon = 0;
-                    RTLockValidatorRecExclInit(&pThis->ValidatorRec, hClass, uSubClass, pThis,
-                                               !(fFlags & RTSEMMUTEX_FLAGS_NO_LOCK_VAL),
-                                               "RTSemMutex-%u", ASMAtomicIncU32(&s_iMutexAnon) - 1);
-                }
-                else
-                {
-                    va_list va;
-                    va_start(va, pszNameFmt);
-                    RTLockValidatorRecExclInitV(&pThis->ValidatorRec, hClass, uSubClass, pThis,
-                                                !(fFlags & RTSEMMUTEX_FLAGS_NO_LOCK_VAL), pszNameFmt, va);
-                    va_end(va);
-                }
-#endif
-
-                *phMutexSem = pThis;
-                return VINF_SUCCESS;
+                static uint32_t volatile s_iMutexAnon = 0;
+                RTLockValidatorRecExclInit(&pThis->ValidatorRec, hClass, uSubClass, pThis,
+                                           !(fFlags & RTSEMMUTEX_FLAGS_NO_LOCK_VAL),
+                                           "RTSemMutex-%u", ASMAtomicIncU32(&s_iMutexAnon) - 1);
             }
-            pthread_mutexattr_destroy(&MutexAttr);
+            else
+            {
+                va_list va;
+                va_start(va, pszNameFmt);
+                RTLockValidatorRecExclInitV(&pThis->ValidatorRec, hClass, uSubClass, pThis,
+                                            !(fFlags & RTSEMMUTEX_FLAGS_NO_LOCK_VAL), pszNameFmt, va);
+                va_end(va);
+            }
+#endif
+
+            *phMutexSem = pThis;
+            return VINF_SUCCESS;
         }
         RTMemFree(pThis);
Index: trunk/src/VBox/Runtime/r3/posix/semrw-posix.cpp
===================================================================
--- trunk/src/VBox/Runtime/r3/posix/semrw-posix.cpp	(revision 61750)
+++ trunk/src/VBox/Runtime/r3/posix/semrw-posix.cpp	(revision 61751)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2015 Oracle Corporation
+ * Copyright (C) 2006-2016 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -113,44 +113,39 @@
          * Create the rwlock.
          */
-        pthread_rwlockattr_t Attr;
-        rc = pthread_rwlockattr_init(&Attr);
+        rc = pthread_rwlock_init(&pThis->RWLock, NULL);
         if (!rc)
         {
-            rc = pthread_rwlock_init(&pThis->RWLock, &Attr);
-            if (!rc)
+            pThis->u32Magic     = RTSEMRW_MAGIC;
+            pThis->cReaders     = 0;
+            pThis->cWrites      = 0;
+            pThis->cWriterReads = 0;
+            pThis->Writer       = (pthread_t)-1;
+#ifdef RTSEMRW_STRICT
+            bool const fLVEnabled = !(fFlags & RTSEMRW_FLAGS_NO_LOCK_VAL);
+            if (!pszNameFmt)
             {
-                pThis->u32Magic     = RTSEMRW_MAGIC;
-                pThis->cReaders     = 0;
-                pThis->cWrites      = 0;
-                pThis->cWriterReads = 0;
-                pThis->Writer       = (pthread_t)-1;
-#ifdef RTSEMRW_STRICT
-                bool const fLVEnabled = !(fFlags & RTSEMRW_FLAGS_NO_LOCK_VAL);
-                if (!pszNameFmt)
-                {
-                    static uint32_t volatile s_iSemRWAnon = 0;
-                    uint32_t i = ASMAtomicIncU32(&s_iSemRWAnon) - 1;
-                    RTLockValidatorRecExclInit(&pThis->ValidatorWrite, hClass, uSubClass, pThis,
-                                               fLVEnabled, "RTSemRW-%u", i);
-                    RTLockValidatorRecSharedInit(&pThis->ValidatorRead, hClass, uSubClass, pThis,
-                                                 false /*fSignaller*/, fLVEnabled, "RTSemRW-%u", i);
-                }
-                else
-                {
-                    va_list va;
-                    va_start(va, pszNameFmt);
-                    RTLockValidatorRecExclInitV(&pThis->ValidatorWrite, hClass, uSubClass, pThis,
-                                                fLVEnabled, pszNameFmt, va);
-                    va_end(va);
-                    va_start(va, pszNameFmt);
-                    RTLockValidatorRecSharedInitV(&pThis->ValidatorRead, hClass, uSubClass, pThis,
-                                                  false /*fSignaller*/, fLVEnabled, pszNameFmt, va);
-                    va_end(va);
-                }
-                RTLockValidatorRecMakeSiblings(&pThis->ValidatorWrite.Core, &pThis->ValidatorRead.Core);
-#endif
-                *phRWSem = pThis;
-                return VINF_SUCCESS;
+                static uint32_t volatile s_iSemRWAnon = 0;
+                uint32_t i = ASMAtomicIncU32(&s_iSemRWAnon) - 1;
+                RTLockValidatorRecExclInit(&pThis->ValidatorWrite, hClass, uSubClass, pThis,
+                                           fLVEnabled, "RTSemRW-%u", i);
+                RTLockValidatorRecSharedInit(&pThis->ValidatorRead, hClass, uSubClass, pThis,
+                                             false /*fSignaller*/, fLVEnabled, "RTSemRW-%u", i);
             }
+            else
+            {
+                va_list va;
+                va_start(va, pszNameFmt);
+                RTLockValidatorRecExclInitV(&pThis->ValidatorWrite, hClass, uSubClass, pThis,
+                                            fLVEnabled, pszNameFmt, va);
+                va_end(va);
+                va_start(va, pszNameFmt);
+                RTLockValidatorRecSharedInitV(&pThis->ValidatorRead, hClass, uSubClass, pThis,
+                                              false /*fSignaller*/, fLVEnabled, pszNameFmt, va);
+                va_end(va);
+            }
+            RTLockValidatorRecMakeSiblings(&pThis->ValidatorWrite.Core, &pThis->ValidatorRead.Core);
+#endif
+            *phRWSem = pThis;
+            return VINF_SUCCESS;
         }
 
Index: trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp
===================================================================
--- trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp	(revision 61750)
+++ trunk/src/VBox/Runtime/r3/posix/thread-posix.cpp	(revision 61751)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2015 Oracle Corporation
+ * Copyright (C) 2006-2016 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -362,4 +362,5 @@
                 if (!rc)
                 {
+                    pthread_attr_destroy(&ThreadAttr);
                     *pNativeThread = (uintptr_t)ThreadId;
                     return VINF_SUCCESS;
