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:
Mike Makonnen 2003-05-21 03:29:18 +00:00
parent 3f07b4bcbd
commit f97591bf25

View File

@ -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.