summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_mutex.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2006-12-20 04:43:34 +0000
committerdavidxu <davidxu@FreeBSD.org>2006-12-20 04:43:34 +0000
commite034ab54f2626f6cd7ab57942ba3b032684d2ed4 (patch)
treedd4940685abc260ad48b4612a46be2cb05f279aa /lib/libthr/thread/thr_mutex.c
parent5a984630fa31489671b035bd30308b299b2e2b50 (diff)
downloadFreeBSD-src-e034ab54f2626f6cd7ab57942ba3b032684d2ed4.zip
FreeBSD-src-e034ab54f2626f6cd7ab57942ba3b032684d2ed4.tar.gz
Check environment variable PTHREAD_ADAPTIVE_SPIN, if it is set, use
it as a default spin cycle count.
Diffstat (limited to 'lib/libthr/thread/thr_mutex.c')
-rw-r--r--lib/libthr/thread/thr_mutex.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c
index aae27aa..17e067a 100644
--- a/lib/libthr/thread/thr_mutex.c
+++ b/lib/libthr/thread/thr_mutex.c
@@ -136,6 +136,7 @@ mutex_init(pthread_mutex_t *mutex,
pmutex->m_lock.m_owner = UMUTEX_UNOWNED;
pmutex->m_lock.m_flags = 0;
}
+ pmutex->m_lock.m_spincount = _thr_adaptive_spin;
*mutex = pmutex;
return (0);
}
OpenPOWER on IntegriCloud