From 268f43638fe4969c216a6a138f259dd36a89b5c0 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Sat, 16 Nov 2013 10:36:27 +0100 Subject: Ignore ERROR_WAIT_NO_CHILDREN issued by WaitForSingleObject ERROR_WAIT_NO_CHILDREN means a thread was killed (lane terminated because of error raised during a linda transfer for example) while having grabbed some mutex this seems not to be a big problem as we will grab it just the same, so ignore this particular error --- src/threading.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src') 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 ) { if (!CloseHandle(*ref)) FAIL( "CloseHandle (mutex)", GetLastError() ); *ref= NULL; } - void MUTEX_LOCK( MUTEX_T *ref ) { - DWORD rc= WaitForSingleObject(*ref,INFINITE); - if (rc!=0) FAIL( "WaitForSingleObject", rc==WAIT_FAILED ? GetLastError() : rc ); - } + void MUTEX_LOCK( MUTEX_T *ref ) + { + DWORD rc = WaitForSingleObject( *ref, INFINITE); + // 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 + // this is not a big problem as we will grab it just the same, so ignore this particular error + if( rc != 0 && rc != ERROR_WAIT_NO_CHILDREN) + FAIL( "WaitForSingleObject", (rc == WAIT_FAILED) ? GetLastError() : rc); + } void MUTEX_UNLOCK( MUTEX_T *ref ) { if (!ReleaseMutex(*ref)) FAIL( "ReleaseMutex", GetLastError() ); -- cgit v1.2.3-55-g6feb