Fix fork problem 114_bound_signal

There is a race condition in old libc in fork().
The result was that 'end' was sometimes printed twice.

This did not happen with glibc-2.32.
This commit is contained in:
herman ten brugge 2020-11-10 10:08:30 +01:00
parent 54b4aa3cd6
commit 08d8015750

View File

@ -116,8 +116,6 @@ main (void)
while (time(NULL) < end) ;
run = 0;
printf ("end\n"); fflush(stdout);
pthread_join(id1, NULL);
pthread_join(id2, NULL);
#if !defined(__APPLE__)
@ -126,6 +124,8 @@ main (void)
sem_destroy (&sem);
sem_destroy (&sem_child);
printf ("end\n"); fflush(stdout);
sigemptyset (&m);
sigprocmask (SIG_SETMASK, &m, NULL);
if (sigsetjmp (sj, 0) == 0)