mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-15 05:20:06 +08:00
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:
parent
54b4aa3cd6
commit
08d8015750
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user