Fix possible signal race in tests
This commit is contained in:
@@ -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
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user