diff --git a/deps/worker.c b/deps/worker.c index 44e2b8e..4b8af23 100644 --- a/deps/worker.c +++ b/deps/worker.c @@ -144,10 +144,10 @@ static void *worker_entry(void *arg) { ts.tv_sec += 1; pthread_cond_timedwait(&thread->cond, &thread->mu, &ts); if (thread->len == 0) { - thread->th = 0; if (!thread->end) { pthread_detach(thread->th); } + thread->th = 0; thread->end = false; break; } diff --git a/neco.c b/neco.c index 322265c..51d8110 100644 --- a/neco.c +++ b/neco.c @@ -2739,10 +2739,10 @@ static void *worker_entry(void *arg) { ts.tv_sec += 1; pthread_cond_timedwait(&thread->cond, &thread->mu, &ts); if (thread->len == 0) { - thread->th = 0; if (!thread->end) { pthread_detach(thread->th); } + thread->th = 0; thread->end = false; break; }