summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2012-03-26 18:29:23 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-03-26 18:29:23 -0700
commitb52c941ed4f24134b78a73daee84bdc328f969da (patch)
treedb5f9975d6e92f137b9d4e72238f2705a01a7556
parentbe741d472868a8ffcb455588f18cda889b0f465c (diff)
parentd7c6147eff65572762d55950b965db949ccd0281 (diff)
downloadbionic-b52c941ed4f24134b78a73daee84bdc328f969da.zip
bionic-b52c941ed4f24134b78a73daee84bdc328f969da.tar.gz
bionic-b52c941ed4f24134b78a73daee84bdc328f969da.tar.bz2
am d7c6147e: am 56731351: Merge "bionic: fix atfork hanlder_mutex deadlock"
* commit 'd7c6147eff65572762d55950b965db949ccd0281': bionic: fix atfork hanlder_mutex deadlock
-rw-r--r--libc/bionic/pthread-atfork.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libc/bionic/pthread-atfork.c b/libc/bionic/pthread-atfork.c
index 3a5189d..42420dc 100644
--- a/libc/bionic/pthread-atfork.c
+++ b/libc/bionic/pthread-atfork.c
@@ -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()