summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_private.h
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2010-09-01 03:11:21 +0000
committerdavidxu <davidxu@FreeBSD.org>2010-09-01 03:11:21 +0000
commit5f00b957aee7c4cc6138734e4b4dc582cf4d10f9 (patch)
tree121f43c8c92789442e82ae22a69ea70be4586b0a /lib/libthr/thread/thr_private.h
parent4dcb50723aa0d3f4264ee1d9ca3baf70b4adc2de (diff)
downloadFreeBSD-src-5f00b957aee7c4cc6138734e4b4dc582cf4d10f9.zip
FreeBSD-src-5f00b957aee7c4cc6138734e4b4dc582cf4d10f9.tar.gz
Change atfork lock from mutex to rwlock, also make mutexes used by malloc()
module private type, when private type mutex is locked/unlocked, thread critical region is entered or leaved. These changes makes fork() async-signal safe which required by POSIX. Note that user's atfork handler still needs to be async-signal safe, but it is not problem of libthr, it is user's responsiblity.
Diffstat (limited to 'lib/libthr/thread/thr_private.h')
-rw-r--r--lib/libthr/thread/thr_private.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libthr/thread/thr_private.h b/lib/libthr/thread/thr_private.h
index 492d58d..a6bc205 100644
--- a/lib/libthr/thread/thr_private.h
+++ b/lib/libthr/thread/thr_private.h
@@ -132,6 +132,7 @@ struct pthread_mutex {
int m_refcount;
int m_spinloops;
int m_yieldloops;
+ int m_private;
/*
* Link for all mutexes a thread currently owns.
*/
@@ -587,7 +588,7 @@ extern pthreadlist _thread_gc_list __hidden;
extern int _thread_active_threads;
extern atfork_head _thr_atfork_list __hidden;
-extern struct umutex _thr_atfork_lock __hidden;
+extern struct urwlock _thr_atfork_lock __hidden;
/* Default thread attributes: */
extern struct pthread_attr _pthread_attr_default __hidden;
OpenPOWER on IntegriCloud