diff options
author | deischen <deischen@FreeBSD.org> | 2004-08-12 12:12:12 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2004-08-12 12:12:12 +0000 |
commit | 0340faafa1e860a32729f20649b0e508d257006e (patch) | |
tree | f5cde2cd4e3f3ec2684cfd283ab1b57e8981d4b1 /lib/libpthread/thread/thr_kern.c | |
parent | 328c4c7fcefd02207b2a88ae95b841d9721afeec (diff) | |
download | FreeBSD-src-0340faafa1e860a32729f20649b0e508d257006e.zip FreeBSD-src-0340faafa1e860a32729f20649b0e508d257006e.tar.gz |
As long as we have a knob to force system scope threads, why not have
a knob to force process scope threads. If the environment variable
LIBPTHREAD_PROCESS_SCOPE is set, force all threads to be process
scope threads regardless of how the application creates them. If
LIBPTHREAD_SYSTEM_SCOPE is set (forcing system scope threads), it
overrides LIBPTHREAD_PROCESS_SCOPE.
$ # To force system scope threads
$ LIBPTHREAD_SYSTEM_SCOPE=anything threaded_app
$ # To force process scope threads
$ LIBPTHREAD_PROCESS_SCOPE=anything threaded_app
Diffstat (limited to 'lib/libpthread/thread/thr_kern.c')
-rw-r--r-- | lib/libpthread/thread/thr_kern.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libpthread/thread/thr_kern.c b/lib/libpthread/thread/thr_kern.c index e29f985..926ca4b 100644 --- a/lib/libpthread/thread/thr_kern.c +++ b/lib/libpthread/thread/thr_kern.c @@ -75,8 +75,8 @@ __FBSDID("$FreeBSD$"); * same number of KSEs and KSE groups as threads. Once these levels are * reached, any extra KSE and KSE groups will be free()'d. */ -#define MAX_CACHED_KSES ((_thread_scope_system == 0) ? 50 : 100) -#define MAX_CACHED_KSEGS ((_thread_scope_system == 0) ? 50 : 100) +#define MAX_CACHED_KSES ((_thread_scope_system <= 0) ? 50 : 100) +#define MAX_CACHED_KSEGS ((_thread_scope_system <= 0) ? 50 : 100) #define KSE_SET_MBOX(kse, thrd) \ (kse)->k_kcb->kcb_kmbx.km_curthread = &(thrd)->tcb->tcb_tmbx @@ -407,7 +407,7 @@ _kse_setthreaded(int threaded) */ _kse_initial->k_flags |= KF_STARTED; - if (_thread_scope_system == 0) { + if (_thread_scope_system <= 0) { _thr_initial->attr.flags &= ~PTHREAD_SCOPE_SYSTEM; _kse_initial->k_kseg->kg_flags &= ~KGF_SINGLE_THREAD; _kse_initial->k_kcb->kcb_kmbx.km_curthread = NULL; @@ -439,7 +439,7 @@ _kse_setthreaded(int threaded) _kse_initial->k_kcb->kcb_kmbx.km_lwp; _thread_activated = 1; - if (_thread_scope_system == 0) { + if (_thread_scope_system <= 0) { /* Set current thread to initial thread */ _tcb_set(_kse_initial->k_kcb, _thr_initial->tcb); KSE_SET_MBOX(_kse_initial, _thr_initial); |