[project @ 2004-03-13 00:56:45 by sof]
[ghc-hetmet.git] / ghc / rts / OSThreads.c
index 06b905a..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;
 }
 
@@ -259,7 +261,7 @@ forkOS_createThread ( HsStablePtr entry )
 #else /* !defined(RTS_SUPPORTS_THREADS) */
 
 int
-forkOS_createThread ( HsStablePtr entry )
+forkOS_createThread ( HsStablePtr entry STG_UNUSED )
 {
     return -1;
 }