X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Fwin32%2FOSThreads.c;h=32800e73bdd2b6778a3a9087e0c8ae4cdcefe767;hb=fe07f054d7ae5e10b14d5fed730fe4424dabd587;hp=c772be38f4ed3e7b6400280153ff9f4dbcc56473;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/rts/win32/OSThreads.c b/rts/win32/OSThreads.c index c772be3..32800e7 100644 --- a/rts/win32/OSThreads.c +++ b/rts/win32/OSThreads.c @@ -38,7 +38,8 @@ initCondition( Condition* pCond ) NULL); /* unnamed => process-local. */ if ( h == NULL ) { - errorBelch("initCondition: unable to create"); + sysErrorBelch("initCondition: unable to create"); + stg_exit(EXIT_FAILURE); } *pCond = h; return; @@ -48,7 +49,7 @@ void closeCondition( Condition* pCond ) { if ( CloseHandle(*pCond) == 0 ) { - errorBelch("closeCondition: failed to close"); + sysErrorBelch("closeCondition: failed to close"); } return; } @@ -64,7 +65,8 @@ rtsBool signalCondition ( Condition* pCond ) { if (SetEvent(*pCond) == 0) { - barf("SetEvent: %d", GetLastError()); + sysErrorBelch("SetEvent"); + stg_exit(EXIT_FAILURE); } return rtsTrue; } @@ -116,6 +118,11 @@ initMutex (Mutex* pMut) { InitializeCriticalSectionAndSpinCount(pMut,4000); } +void +closeMutex (Mutex* pMut) +{ + DeleteCriticalSection(pMut); +} #else void initMutex (Mutex* pMut) @@ -127,6 +134,11 @@ initMutex (Mutex* pMut) *pMut = h; return; } +void +closeMutex (Mutex* pMut) +{ + CloseHandle(*pMut); +} #endif void