mirror of
https://github.com/ptitSeb/box64.git
synced 2025-10-14 02:38:54 +08:00
[TESTS] Make test09 deterministic (#698)
This commit is contained in:
BIN
tests/test09
BIN
tests/test09
Binary file not shown.
@@ -1,5 +1,6 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/types.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);
|
||||
}
|
||||
}
|
||||
@@ -17,4 +18,4 @@ int main()
|
||||
{
|
||||
forkexample();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user