]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
lib/lock: another missing piece is restored
authorVMware, Inc <>
Wed, 21 Dec 2011 23:59:55 +0000 (15:59 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Wed, 21 Dec 2011 23:59:55 +0000 (15:59 -0800)
This one disappeared too. Put it back.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/lock/ulInt.h

index 30f6e1d1dea1de7b4586394240bc10420457b933..82f9fe586410c7c549e7e409892a78ba42aaea31 100644 (file)
@@ -394,7 +394,22 @@ MXRecLockRelease(MXRecLock *lock)  // IN/OUT:
 static INLINE void *
 MXUserGetThreadID(void)
 {
+#if defined(_WIN32)
+   /*
+    * On Windows there is a problem with using VThread_CurID() - it doesn't
+    * maintain unique thread ID values (PR 780775). Native thread ID values
+    * and special handling are used to resolve issues.
+    */
+
+   return (void *) (uintptr_t) GetCurrentThreadId();  // DWORD
+#else
+   /*
+    * Outside of Windows there are no known issues with using VThread_CurID
+    * so that is what is used.
+    */
+
    return (void *) (uintptr_t) VThread_CurID();  // unsigned
+#endif
 }
 
 /*