X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FOSThreads.c;h=01e0a251a1b6afccece1f98e32f7932a35955f33;hb=52bd2cc7a9f328e6a7f3f50ac0055a5361f457c1;hp=16a4ca19888e7d139221dd6fa1d60f940a177cdc;hpb=bf96cc34ae37e24412f4a110666aca90b8b8161e;p=ghc-hetmet.git diff --git a/ghc/rts/OSThreads.c b/ghc/rts/OSThreads.c index 16a4ca1..01e0a25 100644 --- a/ghc/rts/OSThreads.c +++ b/ghc/rts/OSThreads.c @@ -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