From: Rafael Garcia-Suarez Date: Tue, 31 Oct 2006 14:47:25 +0000 (+0000) Subject: Fix a case of segfault in ithread destruction X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5984bebf3eccb13848cd7a8b970b60f597fd78db;p=p5sagit%2Fp5-mst-13.2.git Fix a case of segfault in ithread destruction p4raw-id: //depot/perl@29174 --- diff --git a/ext/threads/threads.xs b/ext/threads/threads.xs index 81f9f65..977a47a 100755 --- a/ext/threads/threads.xs +++ b/ext/threads/threads.xs @@ -174,8 +174,8 @@ S_ithread_destruct(pTHX_ ithread *thread) /* Remove from circular list of threads */ MUTEX_LOCK(&MY_POOL.create_destruct_mutex); - thread->next->prev = thread->prev; - thread->prev->next = thread->next; + if (thread->next) thread->next->prev = thread->prev; + if (thread->prev) thread->prev->next = thread->next; thread->next = NULL; thread->prev = NULL; MUTEX_UNLOCK(&MY_POOL.create_destruct_mutex);