summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_init.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2010-09-28 04:57:56 +0000
committerdavidxu <davidxu@FreeBSD.org>2010-09-28 04:57:56 +0000
commitf329bc965ca427c52c33f2fac97475453de89481 (patch)
treef872a487f24df43510c209db3f83597d42e3cbc0 /lib/libthr/thread/thr_init.c
parent2451920d9872c75b7c2c7d3c85890a25ed2ac3c0 (diff)
downloadFreeBSD-src-f329bc965ca427c52c33f2fac97475453de89481.zip
FreeBSD-src-f329bc965ca427c52c33f2fac97475453de89481.tar.gz
In current code, statically initialized and destroyed object have
same null value, the code can not distinguish between them, to fix the problem, now a destroyed object is assigned to a non-null value, and it will be rejected by some pthread functions. PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP is changed to number 1, so that adaptive mutex can be statically initialized correctly.
Diffstat (limited to 'lib/libthr/thread/thr_init.c')
-rw-r--r--lib/libthr/thread/thr_init.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c
index e8a01d3..b10c227 100644
--- a/lib/libthr/thread/thr_init.c
+++ b/lib/libthr/thread/thr_init.c
@@ -92,6 +92,12 @@ struct pthread_mutex_attr _pthread_mutexattr_default = {
.m_ceiling = 0
};
+struct pthread_mutex_attr _pthread_mutexattr_adaptive_default = {
+ .m_type = PTHREAD_MUTEX_ADAPTIVE_NP,
+ .m_protocol = PTHREAD_PRIO_NONE,
+ .m_ceiling = 0
+};
+
/* Default condition variable attributes: */
struct pthread_cond_attr _pthread_condattr_default = {
.c_pshared = PTHREAD_PROCESS_PRIVATE,
OpenPOWER on IntegriCloud