X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=libust%2Ftracectl.c;h=3b60975391abf72c155f9822a1b06fe3db68004d;hb=0b362d6f999cbbe4b1a0d8cee2a9fb9a34422b7a;hp=bef4537dd4ffeb5311c4e83dabbf60adfbb3fbd3;hpb=fd9c2963da6a81c0d04e09e21156ddcf2fa5efff;p=ust.git diff --git a/libust/tracectl.c b/libust/tracectl.c index bef4537..3b60975 100644 --- a/libust/tracectl.c +++ b/libust/tracectl.c @@ -1711,7 +1711,7 @@ static void ust_after_fork_common(ust_fork_info_t *fork_info) void ust_after_fork_parent(ust_fork_info_t *fork_info) { - /* Reenable signals */ + /* Release mutexes and reenable signals */ ust_after_fork_common(fork_info); } @@ -1720,7 +1720,15 @@ void ust_after_fork_child(ust_fork_info_t *fork_info) /* First sanitize the child */ ust_fork(); - /* Then reenable interrupts */ + /* Then release mutexes and reenable signals */ ust_after_fork_common(fork_info); + + /* + * Make sure we clean up the urcu-bp thread list in the child by running + * the garbage collection before any pthread_create can be called. + * Failure to do so could lead to a deadlock caused by reuse of a thread + * ID before urcu-bp garbage collection is performed. + */ + synchronize_rcu(); }