Restore correct sleep values

This commit is contained in:
Wildan M
2026-01-05 14:38:39 +07:00
parent 13b105a54e
commit 7f30fd2c42
13 changed files with 20 additions and 20 deletions
+1 -1
View File
@@ -9,7 +9,7 @@
void *routine(void *arg) {
assert(arg == NULL);
usleep(100);
usleep(100000);
puts("Thread succeeded");
+1 -1
View File
@@ -15,7 +15,7 @@ struct arg2 {
void *routine1(void *arg) {
assert(arg == NULL);
puts("Thread 1 spawned, waiting 1s.");
usleep(100);
usleep(100000);
puts("Thread 1 finished.");
return strdup("message from thread 1");
}
+1 -1
View File
@@ -20,7 +20,7 @@ int main(void) {
int status;
puts("Start, sleeping 1 second");
usleep(100);
usleep(100000);
pthread_t thread;
void *arg = NULL;
if ((status = pthread_create(&thread, NULL, thread_main, arg)) != 0) {
+1 -1
View File
@@ -26,7 +26,7 @@ int main() {
if (pid == 0) {
// Test behavior on Redox when TRACEME hasn't been activated
// before waitpid is invoked!
usleep(100);
usleep(100000);
int result = ptrace(PTRACE_TRACEME, 0, NULL, NULL);
ERROR_IF(ptrace, result, == -1);
+1 -1
View File
@@ -37,7 +37,7 @@ int killpg_test2(int signum)
int i;
sigignore(signum);
usleep(100);
usleep(100000);
child_pgid = getpgid(child_pid);
ERROR_IF(getpgid, child_pgid, == -1);
+4 -4
View File
@@ -38,7 +38,7 @@ void *a_thread_func( void *arg)
sem1=INMAIN;
while(sem1==INMAIN)
usleep(100);
usleep(100000);
// sleep(50);
@@ -61,16 +61,16 @@ int pthread_kill_test1(int signum)
ERROR_IF(pthread_create, status, != 0);
while(sem1==INTHREAD)
usleep(100);
usleep(100000);
status = pthread_kill(new_th, signum);
ERROR_IF(pthread_kill, status, != 0);
usleep(200);
usleep(100000);
sem1=INTHREAD;
while(handler_called==0)
usleep(100);
usleep(100000);
ERROR_IF(pthread_kill, handler_called, == -1);
ERROR_IF(pthread_kill, handler_called, == 0);
+2 -2
View File
@@ -71,14 +71,14 @@ int sigpause_error(int signum){
status = pthread_create(&new_th, NULL, d_thread_func, (void *)&signum);
ERROR_IF(pthread_create, status, != 0);
usleep(100);
usleep(100000);
status = pthread_kill(new_th, signum);
ERROR_IF(pthread_kill, status, != 0);
sem = INTHREAD;
while (sem == INTHREAD)
usleep(100);
usleep(100000);
if(result == 2) {
exit(EXIT_FAILURE);
+2 -2
View File
@@ -45,12 +45,12 @@ int sigpause_basic(int signum)
status = pthread_create(&new_th, NULL, a_thread_func, (void *)&signum);
ERROR_IF(pthread_create, status, != 0);
usleep(100);
usleep(100000);
status = pthread_kill(new_th, signum);
ERROR_IF(pthread_kill, status, != 0);
usleep(100);
usleep(100000);
if (handler_called != 1){
prinft("handler wasn't called\n");
+1 -1
View File
@@ -77,7 +77,7 @@ int sigpause_revert(int signum) {
exit(EXIT_FAILURE);
}
usleep(100);
usleep(100000);
if((status = pthread_kill(new_th, signum)) != 0)
{
+1 -1
View File
@@ -55,7 +55,7 @@ int sigpause_suspend(int signum)
perror("failed to create thread");
return EXIT_FAILURE;
}
usleep(100);
usleep(100000);
assert(!atomic_load(&completed));
if ((status = pthread_kill(new_th, signum)) != 0) {
+1 -1
View File
@@ -32,7 +32,7 @@ int main(void)
// exit(EXIT_FAILURE);
// }
int us_status = usleep(100);
int us_status = usleep(100000);
ERROR_IF(usleep, us_status, == -1);
UNEXP_IF(usleep, us_status, != 0);
+1 -1
View File
@@ -12,7 +12,7 @@ void for_code(int code) {
// Testing successful exit
if (pid == 0) {
// child
usleep(100);
usleep(100000);
_Exit(code);
}
printf("Testing waitpid of child %d for code %d\n", pid, code);
+3 -3
View File
@@ -14,6 +14,7 @@ int main(void) {
ERROR_IF(fork, pid_samepgid, == -1);
if (pid_samepgid == 0) {
// child
usleep(300000);
_Exit(2);
}
@@ -25,6 +26,8 @@ int main(void) {
if (pid_diffpgids[i] == 0) {
int ret = setpgid(0, 0);
ERROR_IF(setpgid, ret, == -1);
// child
usleep((i + 1) * 100000);
_Exit(i);
}
@@ -35,7 +38,6 @@ int main(void) {
// First, check that the first different-pgid proc is recognized.
wid = waitpid(-1, &status, 0);
ERROR_IF(waitpid, wid, == -1);
printf("wait 1: got %d, expected %d\n", wid, pid_diffpgids[0]);
assert(wid == pid_diffpgids[0]);
assert(WIFEXITED(status));
assert(WEXITSTATUS(status) == 0);
@@ -43,7 +45,6 @@ int main(void) {
// Then, check that the longest-waiting proc with the same pgid is properly matched.
wid = waitpid(0, &status, 0);
ERROR_IF(waitpid, wid, == -1);
printf("wait 2: got %d, expected %d\n", wid, pid_samepgid);
assert(wid == pid_samepgid);
assert(WIFEXITED(status));
assert(WEXITSTATUS(status) == 2);
@@ -51,7 +52,6 @@ int main(void) {
// Finally, the last different-pgid must have completed.
wid = waitpid(-1, &status, WNOHANG);
ERROR_IF(waitpid, wid, == -1);
printf("wait 3: got %d, expected %d\n", wid, pid_diffpgids[1]);
assert(wid == pid_diffpgids[1]);
assert(WIFEXITED(status));
assert(WEXITSTATUS(status) == 1);