DRD: do not assert() upon fork(). Fixes the DRD part of #255355.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11520 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/drd/drd_thread.c b/drd/drd_thread.c
index 909bb45..f85a5b0 100644
--- a/drd/drd_thread.c
+++ b/drd/drd_thread.c
@@ -504,6 +504,21 @@
}
}
+/** Called just after fork() in the child process. */
+void DRD_(drd_thread_atfork_child)(const DrdThreadId tid)
+{
+ unsigned i;
+
+ for (i = 1; i < DRD_N_THREADS; i++)
+ {
+ if (i == tid)
+ continue;
+ if (DRD_(IsValidDrdThreadId(i)))
+ DRD_(thread_delete)(i);
+ tl_assert(!DRD_(IsValidDrdThreadId(i)));
+ }
+}
+
/** Called just before pthread_cancel(). */
void DRD_(thread_pre_cancel)(const DrdThreadId tid)
{