[project @ 2004-09-01 08:43:23 by simonmar]
[ghc-hetmet.git] / ghc / rts / OSThreads.c
index 5d3c8c9..ca8fd6d 100644 (file)
@@ -169,17 +169,19 @@ broadcastCondition ( Condition* pCond )
 rtsBool
 signalCondition ( Condition* pCond )
 {
-  SetEvent(*pCond);
-  return rtsTrue;
+    if (SetEvent(*pCond) == 0) {
+       barf("SetEvent: %d", GetLastError());
+    }
+    return rtsTrue;
 }
 
 rtsBool
 waitCondition ( Condition* pCond, Mutex* pMut )
 {
-  ReleaseMutex(*pMut);
+  RELEASE_LOCK(pMut);
   WaitForSingleObject(*pCond, INFINITE);
   /* Hmm..use WaitForMultipleObjects() ? */
-  WaitForSingleObject(*pMut, INFINITE);
+  ACQUIRE_LOCK(pMut);
   return rtsTrue;
 }