]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
temp revert of various ulCondVar usages/changes
authorVMware, Inc <>
Thu, 17 Jun 2010 21:39:57 +0000 (14:39 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 17 Jun 2010 21:39:57 +0000 (14:39 -0700)
Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/lock/ulCondVar.c

index 5956da4f9badacc9d142bc98fa5b0411f803c11b..2e5e62ab0fb332d43bd47dc76f1041bef2519be5 100644 (file)
@@ -28,7 +28,6 @@
 #include "util.h"
 #include "userlock.h"
 #include "ulInt.h"
-#include "ulIntShared.h"
 
 /*
  * A portable condition variable
@@ -507,9 +506,9 @@ MXUserWaitInternal(MXRecLock *lock,         // IN:
       uint64 endNS;
 
       /*
-       * pthread_cond_timedwait takes an absolute time. Yes, this is beyond
-       * ridiculous, and the justifications for this vs. relative time make
-       * no sense. But IIWII.
+       * pthread_cond_timedwait takes an absolute time. Yes, this is
+       * beyond ridiculous, and the justifications for this
+       * vs. relative time make no sense. But IIWII.
        */
 #define A_BILLION (1000 * 1000 * 1000)
       gettimeofday(&curTime, NULL);
@@ -521,10 +520,11 @@ MXUserWaitInternal(MXRecLock *lock,         // IN:
       endTime.tv_nsec = (long int) (endNS % A_BILLION);
 #undef A_BILLION
 
-      err = pthread_cond_timedwait(&condVar->condObject, &lock->nativeLock,
+      err = pthread_cond_timedwait(&condVar->condObject,
+                                   &lock->nativeLock,
                                    &endTime);
 
-      signalled = (err == 0);
+      signalled = (err == 0) ? TRUE : FALSE;
 
       if (err == ETIMEDOUT) {
          err = 0;
@@ -673,31 +673,7 @@ MXUserWaitCondVar(MXUserHeader *header,    // IN:
    }
 
    Atomic_Inc(&condVar->referenceCount);
-
-   /*
-    * When the watchdog callback has been planted - lib/thread is present
-    * and initialized - call the watchdog periodically on long or infinite
-    * waits.
-    */
-
-   if (MXUserVThreadWatchDog) {
-      do {
-         uint32 thisWait = (msecWait > 1000) ? 1000 : msecWait;
-
-         signalled = MXUserWaitInternal(lock, condVar, thisWait);
-
-         if (thisWait != 0) {
-            (*MXUserVThreadWatchDog)();
-
-            if (msecWait != MXUSER_WAIT_INFINITE) {
-               msecWait -= thisWait;
-            }
-         }
-      } while ((msecWait != 0) && !signalled);
-   } else {
-      signalled = MXUserWaitInternal(lock, condVar, msecWait);
-   }
-
+   signalled = MXUserWaitInternal(lock, condVar, msecWait);
    Atomic_Dec(&condVar->referenceCount);
 
    return signalled;