From: sof Date: Thu, 14 Feb 2002 09:00:41 +0000 (+0000) Subject: [project @ 2002-02-14 09:00:41 by sof] X-Git-Tag: Approximately_9120_patches~58 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;ds=sidebyside;h=4fabd1503c273f9e1734d646038da8bce0757af6;p=ghc-hetmet.git [project @ 2002-02-14 09:00:41 by sof] make multi-threading story work under win32 also --- diff --git a/ghc/rts/OSThreads.c b/ghc/rts/OSThreads.c index a0d3ca8..abfa583 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) == NULL); } OSThreadId