diff --git a/C/threads.c b/C/threads.c index f74249453..f0b2a0edf 100644 --- a/C/threads.c +++ b/C/threads.c @@ -294,7 +294,7 @@ Int Yap_thread_detach_engine(int wid) { pthread_mutex_lock(&(ThreadHandle[wid].tlock)); - if (ThreadHandle[wid].handle == worker_id) + if (ThreadHandle[wid].handle == pthread_self()) ThreadHandle[wid].handle = 0; ThreadHandle[wid].ref_count--; pthread_mutex_unlock(&(ThreadHandle[wid].tlock)); diff --git a/changes-5.1.html b/changes-5.1.html index 06419c9b9..828c6e35f 100644 --- a/changes-5.1.html +++ b/changes-5.1.html @@ -16,6 +16,7 @@

Yap-5.1.2: