mirror of
https://github.com/ptitSeb/box64.git
synced 2025-05-08 16:18:30 +08:00
[TESTS] Make test09 deterministic (#698)
This commit is contained in:
parent
9246f4925b
commit
8a903f1e2c
BIN
tests/test09
BIN
tests/test09
Binary file not shown.
@ -1,5 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
void forkexample()
|
||||
@ -9,7 +10,7 @@ void forkexample()
|
||||
if (fork() == 0)
|
||||
printf("Child has x = %d\n", ++x);
|
||||
else {
|
||||
usleep(20000);
|
||||
wait(NULL);
|
||||
printf("Parent has x = %d\n", --x);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user