aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2013-11-16 10:36:27 +0100
committerBenoit Germain <bnt.germain@gmail.com>2013-11-16 10:36:27 +0100
commit268f43638fe4969c216a6a138f259dd36a89b5c0 (patch)
tree8e27d7984bfd769e2b4cc449e2e9a6142cad57d2 /src
parenteb82ab2e9993111bd6137db73b77d2ce41cf891a (diff)
downloadlanes-268f43638fe4969c216a6a138f259dd36a89b5c0.tar.gz
lanes-268f43638fe4969c216a6a138f259dd36a89b5c0.tar.bz2
lanes-268f43638fe4969c216a6a138f259dd36a89b5c0.zip
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
Diffstat (limited to 'src')
-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() );