diff --git a/src/backend/threads.c b/src/backend/threads.c index 1ff7184f9..46449156b 100644 --- a/src/backend/threads.c +++ b/src/backend/threads.c @@ -59,6 +59,9 @@ static void* pthread_runner (void* thread) starter->fn (starter->arg); + if (!starter->finished) + return NULL; // no condition var provided for signalling thread termination + LUMIERA_RECCONDITION_SECTION(cond_sync, starter->finished) LUMIERA_RECCONDITION_BROADCAST; diff --git a/src/lib/reccondition.h b/src/lib/reccondition.h index a2dd54f58..dcf4e33a4 100644 --- a/src/lib/reccondition.h +++ b/src/lib/reccondition.h @@ -93,7 +93,7 @@ /** * Wait for a condition. * Must be used inside a RECCONDITION_SECTION. - * @param expr Conditon which must become true, else the condition variable goes back into sleep + * @param expr Condition which must become true, else the condition variable goes back into sleep */ #define LUMIERA_RECCONDITION_WAIT(expr) \ do { \