Page MenuHomeFreeBSD

D60486.id189086.diff
No OneTemporary

D60486.id189086.diff

diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c
--- a/lib/libthr/thread/thr_init.c
+++ b/lib/libthr/thread/thr_init.c
@@ -118,7 +118,7 @@
size_t _thr_stack_default = THR_STACK_DEFAULT;
size_t _thr_stack_initial = THR_STACK_INITIAL;
int _thr_page_size;
-int _thr_spinloops;
+int _thr_spinloops = MUTEX_ADAPTIVE_SPINS;
int _thr_yieldloops;
int _thr_queuefifo = 4;
int _gc_count;
diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c
--- a/lib/libthr/thread/thr_mutex.c
+++ b/lib/libthr/thread/thr_mutex.c
@@ -62,12 +62,6 @@
"m_qe must not share a cache line with m_lock.m_owner");
#endif
-/*
- * For adaptive mutexes, how many times to spin doing trylock2
- * before entering the kernel to block
- */
-#define MUTEX_ADAPTIVE_SPINS 2000
-
/*
* Prototypes
*/
@@ -274,8 +268,7 @@
pmutex->m_lock.m_flags |= UMUTEX_ROBUST;
}
if (PMUTEX_TYPE(pmutex->m_flags) == PTHREAD_MUTEX_ADAPTIVE_NP) {
- pmutex->m_spinloops =
- _thr_spinloops ? _thr_spinloops: MUTEX_ADAPTIVE_SPINS;
+ pmutex->m_spinloops = _thr_spinloops;
pmutex->m_yieldloops = _thr_yieldloops;
}
}
diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h
--- a/lib/libthr/thread/thr_private.h
+++ b/lib/libthr/thread/thr_private.h
@@ -154,6 +154,12 @@
#define MAX_DEFER_WAITERS 50
+/*
+ * For adaptive mutexes, how many times to spin doing trylock2
+ * before entering the kernel to block
+ */
+#define MUTEX_ADAPTIVE_SPINS 2000
+
/*
* Values for pthread_mutex m_ps indicator.
*/

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 10, 10:11 AM (3 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40514947
Default Alt Text
D60486.id189086.diff (1 KB)

Event Timeline