mirror of
https://github.com/ptitSeb/box64.git
synced 2025-05-09 00:21:32 +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 <stdio.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
void forkexample()
|
void forkexample()
|
||||||
@ -9,7 +10,7 @@ void forkexample()
|
|||||||
if (fork() == 0)
|
if (fork() == 0)
|
||||||
printf("Child has x = %d\n", ++x);
|
printf("Child has x = %d\n", ++x);
|
||||||
else {
|
else {
|
||||||
usleep(20000);
|
wait(NULL);
|
||||||
printf("Parent has x = %d\n", --x);
|
printf("Parent has x = %d\n", --x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user