Fix possible signal race in tests

This commit is contained in:
Wildan M
2026-05-09 11:14:19 +07:00
parent e8e9aa61f7
commit 2c23024245
2 changed files with 4 additions and 7 deletions
+3 -6
View File
@@ -11,11 +11,8 @@
# define INTHREAD 0
# define INMAIN 1
# define SIGTOTEST SIGABRT
int sem1; /* Manual semaphore */
volatile sig_atomic_t handler_called = 0;
int count = 1;
struct signal {
int signum;
@@ -74,9 +71,10 @@ int pthread_kill_test1(int signum)
ERROR_IF(pthread_kill, handler_called, == -1);
ERROR_IF(pthread_kill, handler_called, == 0);
pthread_join(new_th, NULL);
handler_called = 0;
return EXIT_SUCCESS;
return EXIT_SUCCESS;
}
int main(){
@@ -91,4 +89,3 @@ int main(){
}
return EXIT_SUCCESS;
}
+1 -1
View File
@@ -11,7 +11,7 @@ void prepare() {
void parent() {
// Make sure we print in the right order and also don't exit
// before the fork does.
int us_status = usleep(1000);
int us_status = usleep(100000);
ERROR_IF(usleep, us_status, == -1);
UNEXP_IF(usleep, us_status, != 0);