Merge "bionic: fix atfork hanlder_mutex deadlock"

This commit is contained in:
Jean-Baptiste Queru 2012-03-26 16:19:35 -07:00 committed by android code review
commit 56731351de

View File

@ -74,6 +74,7 @@ void __bionic_atfork_run_prepare()
void __bionic_atfork_run_child()
{
struct atfork_t *cursor;
pthread_mutexattr_t attr;
/* Call pthread_atfork() child handlers */
for (cursor = atfork_head.cqh_first;
@ -84,7 +85,9 @@ void __bionic_atfork_run_child()
}
}
pthread_mutex_unlock(&handler_mutex);
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutex_init(&handler_mutex, &attr);
}
void __bionic_atfork_run_parent()