Enable mutex inheritance code in mutex_fork, I forgot to turn on it.

while here, add some comments about process shared mutex.
This commit is contained in:
David Xu 2006-01-14 11:33:43 +00:00
parent e5bc0aa3c3
commit add2da0db1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154350

View File

@ -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;
}