When a thread exits it does not return from the kernel unless it
is the *only* remaining thread in the application, in which case we should not core dump, and instead exit gracefully. Approved by: markm/mentor, re/blanket libthr
This commit is contained in:
parent
3f07b4bcbd
commit
f97591bf25
@ -171,6 +171,10 @@ _pthread_exit(void *status)
|
||||
PTHREAD_SET_STATE(curthread, PS_DEAD);
|
||||
GIANT_UNLOCK(curthread);
|
||||
|
||||
/* If we're the last thread, call it quits */
|
||||
if (TAILQ_EMPTY(&_thread_list))
|
||||
exit(curthread->ret);
|
||||
|
||||
/*
|
||||
* Retire the architecture specific id so that it can be used for
|
||||
* new threads.
|
||||
|
Loading…
Reference in New Issue
Block a user