aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/threading.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/threading.c b/src/threading.c
index 42c0cde..85ee0c0 100644
--- a/src/threading.c
+++ b/src/threading.c
@@ -255,10 +255,14 @@ static void prepare_timeout( struct timespec *ts, time_d abs_secs ) {
255 if (!CloseHandle(*ref)) FAIL( "CloseHandle (mutex)", GetLastError() ); 255 if (!CloseHandle(*ref)) FAIL( "CloseHandle (mutex)", GetLastError() );
256 *ref= NULL; 256 *ref= NULL;
257 } 257 }
258 void MUTEX_LOCK( MUTEX_T *ref ) { 258 void MUTEX_LOCK( MUTEX_T *ref )
259 DWORD rc= WaitForSingleObject(*ref,INFINITE); 259 {
260 if (rc!=0) FAIL( "WaitForSingleObject", rc==WAIT_FAILED ? GetLastError() : rc ); 260 DWORD rc = WaitForSingleObject( *ref, INFINITE);
261 } 261 // ERROR_WAIT_NO_CHILDREN means a thread was killed (lane terminated because of error raised during a linda transfer for example) while having grabbed this mutex
262 // this is not a big problem as we will grab it just the same, so ignore this particular error
263 if( rc != 0 && rc != ERROR_WAIT_NO_CHILDREN)
264 FAIL( "WaitForSingleObject", (rc == WAIT_FAILED) ? GetLastError() : rc);
265 }
262 void MUTEX_UNLOCK( MUTEX_T *ref ) { 266 void MUTEX_UNLOCK( MUTEX_T *ref ) {
263 if (!ReleaseMutex(*ref)) 267 if (!ReleaseMutex(*ref))
264 FAIL( "ReleaseMutex", GetLastError() ); 268 FAIL( "ReleaseMutex", GetLastError() );