fixed: struct timespec now values weren't set correctly on osx
authorBob van Loosen <bob.loosen@gmail.com>
Sat, 3 Mar 2012 16:36:28 +0000 (17:36 +0100)
committerBob van Loosen <bob.loosen@gmail.com>
Sat, 3 Mar 2012 16:36:28 +0000 (17:36 +0100)
src/lib/platform/posix/os-threads.h

index fc28fc9017235fcb4804797dbf217cd2da8897c3..8b56731adfa2918f2a290e71dd4acc62ce2b7709 100644 (file)
@@ -52,8 +52,8 @@ namespace PLATFORM
     #ifdef __APPLE__
     struct timeval tv;
     gettimeofday(&tv, NULL);
-    now.tv_sec  = tv.tv_sec + 0;
-    now.tv_nsec = 0;
+    now.tv_sec  = tv.tv_sec;
+    now.tv_nsec = tv.tv_usec * 1000;
     #else
     clock_gettime(CLOCK_REALTIME, &now);
     #endif