Fix #1728: racing test (#1764)

pull/1769/head
Disconnect3d 3 years ago committed by GitHub
parent 9d3198f7f8
commit 44d75e3bd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -6,14 +6,6 @@
sem_t sem;
void *thread_function(void *arg)
{
sem_post(&sem);
usleep(4000);
exit(1);
return NULL;
}
void *useless_thread(void *arg)
{
// signal the semaphore to indicate that the thread has started
@ -37,7 +29,7 @@ int main()
sem_init(&sem, 0, 0);
pthread_t thread1, thread2;
int res1 = pthread_create(&thread1, NULL, thread_function, NULL);
int res1 = pthread_create(&thread1, NULL, useless_thread, NULL);
if (res1 != 0) {
perror("Thread creation failed");
exit(EXIT_FAILURE);

@ -33,10 +33,6 @@ def test_command_killthreads_kills_all_threads_except_current(start_binary):
# check if only one thread is left
wait_until(lambda: len(gdb.selected_inferior().threads()) == 1)
gdb.execute("continue")
exit_code = gdb.execute("print $_exitcode", to_string=True)
assert exit_code == "$1 = 0\n" # if the second thread was killed, the exit code should be 0
def test_command_killthreads_kills_specific_thread(start_binary):
start_binary(REFERENCE_BINARY_THREADS)

Loading…
Cancel
Save