X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FOSThreads.c;h=01e0a251a1b6afccece1f98e32f7932a35955f33;hb=b996479a35d1876a1c11a350dc568da7b75fcaf2;hp=a0d3ca84e280e4c4f07bf54f96041b681108d821;hpb=05abfa38be95d3042b09738408ba95beac50418d;p=ghc-hetmet.git diff --git a/ghc/rts/OSThreads.c b/ghc/rts/OSThreads.c index a0d3ca8..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); @@ -174,12 +181,12 @@ int 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