summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fork.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fork.c b/fork.c
index 4ec53a7..0d62226 100644
--- a/fork.c
+++ b/fork.c
@@ -121,6 +121,8 @@ fork()
/* Terminate all threads except pthread_self() using
pthread_cancel(). */
_pthread_cancel_all_not_self();
+
+ /* Wait for them to finish before we continue. */
_pthread_join_all_not_self();
return 0;