[fix] fix race condition.

This commit is contained in:
rootacite
2025-10-24 13:44:27 +08:00
parent 22173f034a
commit ea1821480f
4 changed files with 48 additions and 26 deletions

View File

@@ -4,6 +4,7 @@
#include <unistd.h>
#include <sys/types.h>
int main()
{
pid_t pid = getpid();
@@ -11,6 +12,7 @@ int main()
while(true)
{
sleep(0);
usleep(1000 * 300);
write(1, ".", 1);
}
}
}