Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F175247632
D60486.id189086.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D60486.id189086.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D60486: libthr: Support disable spinloop
Attached
Detach File
Event Timeline
Log In to Comment