NULL); /* unnamed => process-local. */
if ( h == NULL ) {
- belch("initCondition: unable to create");
+ errorBelch("initCondition: unable to create");
}
*pCond = h;
return;
closeCondition( Condition* pCond )
{
if ( CloseHandle(*pCond) == 0 ) {
- belch("closeCondition: failed to close");
+ errorBelch("closeCondition: failed to close");
}
return;
}
rtsBool
signalCondition ( Condition* pCond )
{
- SetEvent(*pCond);
- return rtsTrue;
+ if (SetEvent(*pCond) == 0) {
+ barf("SetEvent: %d", GetLastError());
+ }
+ return rtsTrue;
}
rtsBool
waitCondition ( Condition* pCond, Mutex* pMut )
{
- ReleaseMutex(*pMut);
+ RELEASE_LOCK(pMut);
WaitForSingleObject(*pCond, INFINITE);
/* Hmm..use WaitForMultipleObjects() ? */
- WaitForSingleObject(*pMut, INFINITE);
+ ACQUIRE_LOCK(pMut);
return rtsTrue;
}
#else /* !defined(RTS_SUPPORTS_THREADS) */
int
-forkOS_createThread ( HsStablePtr entry )
+forkOS_createThread ( HsStablePtr entry STG_UNUSED )
{
return -1;
}