summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_exit.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2004-08-07 15:15:38 +0000
committerdeischen <deischen@FreeBSD.org>2004-08-07 15:15:38 +0000
commit628d407e8490a240e6c73a5e9994986e7a9ab164 (patch)
treea52137064a9f6d0ca8cd37a63377945781591df2 /lib/libpthread/thread/thr_exit.c
parent51abab44f50b76d38ee3599125e7890346cd5279 (diff)
downloadFreeBSD-src-628d407e8490a240e6c73a5e9994986e7a9ab164.zip
FreeBSD-src-628d407e8490a240e6c73a5e9994986e7a9ab164.tar.gz
Add a way to force 1:1 mode for libpthread. To do this, define
LIBPTHREAD_SYSTEM_SCOPE in the environment. You can still force libpthread to be built in strictly 1:1 by adding -DSYSTEM_SCOPE_ONLY to CFLAGS. This is kept for archs that don't yet support M:N mode. Requested by: rwatson Reviewed by: davidxu
Diffstat (limited to 'lib/libpthread/thread/thr_exit.c')
-rw-r--r--lib/libpthread/thread/thr_exit.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/libpthread/thread/thr_exit.c b/lib/libpthread/thread/thr_exit.c
index 22aa875..ec8e9ec 100644
--- a/lib/libpthread/thread/thr_exit.c
+++ b/lib/libpthread/thread/thr_exit.c
@@ -126,11 +126,8 @@ _pthread_exit(void *status)
KSE_LOCK_ACQUIRE(curkse, &_thread_list_lock);
/* Use thread_list_lock */
_thread_active_threads--;
-#ifdef SYSTEM_SCOPE_ONLY
- if (_thread_active_threads == 0) {
-#else
- if (_thread_active_threads == 1) {
-#endif
+ if ((_thread_scope_system == 0 && _thread_active_threads == 1) ||
+ (_thread_scope_system != 0 && _thread_active_threads == 0)) {
KSE_LOCK_RELEASE(curkse, &_thread_list_lock);
_kse_critical_leave(crit);
exit(0);
OpenPOWER on IntegriCloud