p4raw-id: //depot/perl@29174
/* 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);