diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-12-20 05:05:44 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-12-20 05:05:44 +0000 |
commit | d305995d6672fcfe6d431ebf2804eb5c72d5f4db (patch) | |
tree | c831f9ef40a847624d5e05c622ce94886f5c2afa /lib/libthr/thread/thr_init.c | |
parent | e034ab54f2626f6cd7ab57942ba3b032684d2ed4 (diff) | |
download | FreeBSD-src-d305995d6672fcfe6d431ebf2804eb5c72d5f4db.zip FreeBSD-src-d305995d6672fcfe6d431ebf2804eb5c72d5f4db.tar.gz |
get LIBPTHREAD_ADAPTIVE_SPIN early, so it can be used for some global
mutexes.
Diffstat (limited to 'lib/libthr/thread/thr_init.c')
-rw-r--r-- | lib/libthr/thread/thr_init.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index 31c361c..7d00a34 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -426,6 +426,11 @@ init_private(void) int mib[2]; char *p; + if (init_once == 0) { + if ((p = getenv("LIBPTHREAD_ADAPTIVE_SPIN")) != NULL) + _thr_adaptive_spin = atoi(p); + } + _thr_umutex_init(&_mutex_static_lock); _thr_umutex_init(&_cond_static_lock); _thr_umutex_init(&_rwlock_static_lock); @@ -456,8 +461,6 @@ init_private(void) _pthread_attr_default.stacksize_attr = _thr_stack_default; TAILQ_INIT(&_thr_atfork_list); - if ((p = getenv("LIBPTHREAD_ADAPTIVE_SPIN")) != NULL) - _thr_adaptive_spin = atoi(p); } init_once = 1; } |