Unlock the master socket if the boot thread terminates early.

Avoid crash if thread died during timeout wakeup.
This commit is contained in:
Alexandre Julliard 2002-06-22 01:20:36 +00:00
parent 8da26fb26a
commit ff73250630
1 changed files with 7 additions and 1 deletions

View File

@ -211,6 +211,12 @@ static void cleanup_thread( struct thread *thread )
thread->request_fd = -1;
thread->reply_fd = -1;
thread->wait_fd = -1;
if (thread == booting_thread) /* killing booting thread */
{
booting_thread = NULL;
lock_master_socket(0);
}
}
/* destroy a thread when its refcount is 0 */
@ -479,7 +485,7 @@ static void thread_timeout( void *ptr )
if (debug_level) fprintf( stderr, "%08x: *wakeup* signaled=%d cookie=%p\n",
(unsigned int)thread, STATUS_TIMEOUT, cookie );
end_wait( thread );
send_thread_wakeup( thread, cookie, STATUS_TIMEOUT );
if (send_thread_wakeup( thread, cookie, STATUS_TIMEOUT ) == -1) return;
/* check if other objects have become signaled in the meantime */
wake_thread( thread );
}