summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2006-01-14 11:33:43 +0000
committerdavidxu <davidxu@FreeBSD.org>2006-01-14 11:33:43 +0000
commitaedf24a684f432770f73a575208ff7f201a475cc (patch)
tree4eb8089b2bb5dd7f931653a829b16d01c2896ed9 /lib
parent01ba13c93ee7336daa7b114c6791cadb58f1785a (diff)
downloadFreeBSD-src-aedf24a684f432770f73a575208ff7f201a475cc.zip
FreeBSD-src-aedf24a684f432770f73a575208ff7f201a475cc.tar.gz
Enable mutex inheritance code in mutex_fork, I forgot to turn on it.
while here, add some comments about process shared mutex.
Diffstat (limited to 'lib')
-rw-r--r--lib/libthr/thread/thr_mutex.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c
index 619cf3c..97fefe9 100644
--- a/lib/libthr/thread/thr_mutex.c
+++ b/lib/libthr/thread/thr_mutex.c
@@ -261,12 +261,22 @@ _mutex_reinit(pthread_mutex_t *mutex)
void
_mutex_fork(struct pthread *curthread)
{
+#if 0
TAILQ_INIT(&curthread->mutexq);
TAILQ_INIT(&curthread->pri_mutexq);
curthread->priority_mutex_count = 0;
-#if 0
+#else
struct pthread_mutex *m;
+ /*
+ * Fix mutex ownership for child process.
+ * note that process shared mutex should not
+ * be inherited because owner is forking thread
+ * which is in parent process, they should be
+ * removed from the owned mutex list, current
+ * process shared mutex is not supported, so I
+ * am not worried.
+ */
TAILQ_FOREACH(m, &curthread->mutexq, m_qe) {
m->m_lock = (umtx_t)curthread->tid;
}
OpenPOWER on IntegriCloud