fix crash on closing lumiera, in case of starting multiple threads
This commit is contained in:
parent
3f9902f682
commit
37c0175bd1
1 changed files with 5 additions and 4 deletions
|
|
@ -56,13 +56,14 @@ static void* pthread_runner (void* thread)
|
|||
pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, NULL);
|
||||
|
||||
struct lumiera_thread_mockup* starter = (struct lumiera_thread_mockup*) thread;
|
||||
LumieraReccondition thread_end_notification = starter->finished;
|
||||
|
||||
starter->fn (starter->arg);
|
||||
|
||||
if (!starter->finished)
|
||||
return NULL; // no condition var provided for signalling thread termination
|
||||
|
||||
LUMIERA_RECCONDITION_SECTION(cond_sync, starter->finished)
|
||||
if (!thread_end_notification)
|
||||
return NULL; // no signalling of thread termination desired
|
||||
|
||||
LUMIERA_RECCONDITION_SECTION(cond_sync, thread_end_notification)
|
||||
LUMIERA_RECCONDITION_BROADCAST;
|
||||
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue