[project @ 2002-12-05 23:49:43 by mthomas]
[ghc-hetmet.git] / ghc / rts / OSThreads.c
index 16a4ca1..01e0a25 100644 (file)
@@ -112,8 +112,8 @@ void
 initCondition( Condition* pCond )
 {
   HANDLE h =  CreateEvent(NULL, 
-                         TRUE,  /* manual reset */
-                         TRUE,  /* initially signalled */
+                         FALSE,  /* auto reset */
+                         FALSE,  /* initially not signalled */
                          NULL); /* unnamed => process-local. */
   
   if ( h == NULL ) {
@@ -157,6 +157,13 @@ waitCondition ( Condition* pCond, Mutex* pMut )
 }
 
 void
+yieldThread()
+{
+  Sleep(0);
+  return;
+}
+
+void
 shutdownThread()
 {
   _endthreadex(0);
@@ -171,15 +178,15 @@ startProcWrapper(void* pReal)
 }
 
 int
-createOSThread ( OSThreadId* pId, void (*startProc)(void*))
+createOSThread ( OSThreadId* pId, void (*startProc)(void))
 {
   
-  return _beginthreadex ( NULL,  /* default security attributes */
-                         0,
-                         startProcWrapper,
-                         (void*)startProc,
-                         0,
-                         (unsigned*)pId);
+  return (_beginthreadex ( NULL,  /* default security attributes */
+                          0,
+                          startProcWrapper,
+                          (void*)startProc,
+                          0,
+                          (unsigned*)pId) == 0);
 }
 
 OSThreadId