Direct call exit if thread was never created. This makes it safe to call

pthread_exit in main() without creating any thread.

Tessted by: deischen
This commit is contained in:
David Xu 2003-08-18 04:03:08 +00:00
parent e81bbed597
commit 962eaaf9d6
2 changed files with 4 additions and 0 deletions

View File

@ -87,6 +87,8 @@ _pthread_exit(void *status)
{
struct pthread *curthread = _get_curthread();
if (!_kse_isthreaded())
exit(0);
/* Check if this thread is already in the process of exiting: */
if ((curthread->flags & THR_FLAGS_EXITING) != 0) {
char msg[128];

View File

@ -87,6 +87,8 @@ _pthread_exit(void *status)
{
struct pthread *curthread = _get_curthread();
if (!_kse_isthreaded())
exit(0);
/* Check if this thread is already in the process of exiting: */
if ((curthread->flags & THR_FLAGS_EXITING) != 0) {
char msg[128];