diff --git a/lib/libkse/thread/thr_exit.c b/lib/libkse/thread/thr_exit.c index 6dbef072a50..5894206a7c5 100644 --- a/lib/libkse/thread/thr_exit.c +++ b/lib/libkse/thread/thr_exit.c @@ -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]; diff --git a/lib/libpthread/thread/thr_exit.c b/lib/libpthread/thread/thr_exit.c index 6dbef072a50..5894206a7c5 100644 --- a/lib/libpthread/thread/thr_exit.c +++ b/lib/libpthread/thread/thr_exit.c @@ -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];