Index: /trunk/src/VBox/Runtime/r3/posix/semmutex-posix.cpp
===================================================================
--- /trunk/src/VBox/Runtime/r3/posix/semmutex-posix.cpp	(revision 43559)
+++ /trunk/src/VBox/Runtime/r3/posix/semmutex-posix.cpp	(revision 43560)
@@ -70,9 +70,9 @@
  * This function emulate pthread_mutex_timedlock on Mac OS X
  */
-static int DarwinPthreadMutexTimedlock(pthread_mutex_t * mutex, const struct timespec * abs_timeout)
+static int DarwinPthreadMutexTimedlock(pthread_mutex_t * mutex, const struct timespec * pTsAbsTimeout)
 {
     int rc = 0;
     struct timeval tv;
-    struct timespec rt;
+    timespec ts = {0, 0};
     do
     {
@@ -80,19 +80,23 @@
         if (rc == EBUSY)
         {
-            timespec ts;
-            ts.tv_sec = 0;
-            ts.tv_sec = 10000000;
-
-            int rcSleep = -1;
-            while (rcSleep == -1)
-                rcSleep = nanosleep(&ts, &ts);
+            gettimeofday(&tv, NULL);
+
+            ts.tv_sec = pTsAbsTimeout->tv_sec - tv.tv_sec;
+            ts.tv_nsec = pTsAbsTimeout->tv_nsec - tv.tv_sec;
+
+            if (ts.tv_nsec < 0)
+            {
+                ts.tv_sec--;
+                ts.tv_nsec += 1000000000;
+            }
+
+            if (   ts.tv_sec > 0
+                && ts.tv_nsec > 0)
+                nanosleep(&ts, &ts);
         }
         else
             break;
-        gettimeofday(&tv, NULL);
-        rt.tv_sec = abs_timeout->tv_sec - tv.tv_sec;
-        rt.tv_nsec = abs_timeout->tv_nsec - tv.tv_usec * 1000;
     } while (   rc != 0
-             || rt.tv_sec < 0);
+             || ts.tv_sec > 0);
     return rc;
 }
