summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-10-31 14:47:25 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-10-31 14:47:25 +0000
commit5984bebf3eccb13848cd7a8b970b60f597fd78db (patch)
tree707eb5395f787e786c951629e433d92c8b0db4e1 /ext
parent51dfe3f7e03fd8d2e9dadd18c223dce6ad08480f (diff)
downloadperl-5984bebf3eccb13848cd7a8b970b60f597fd78db.tar.gz
Fix a case of segfault in ithread destruction
p4raw-id: //depot/perl@29174
Diffstat (limited to 'ext')
-rwxr-xr-xext/threads/threads.xs4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/threads/threads.xs b/ext/threads/threads.xs
index 81f9f65e37..977a47a4b2 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);