From b0fd06a6f27212cee770961171439a44626d8f14 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Tue, 18 Dec 2018 17:07:29 +0400 Subject: MDEV-15670 - unit.my_atomic failed in buildbot with Signal 11 thrown Workaround glibc bug: https://sourceware.org/bugzilla/show_bug.cgi?id=20116 by making unittest threads joinable. It makes code better anyway. --- unittest/mysys/my_atomic-t.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'unittest/mysys/my_atomic-t.c') diff --git a/unittest/mysys/my_atomic-t.c b/unittest/mysys/my_atomic-t.c index 35e782eb360..5eb988e2e15 100644 --- a/unittest/mysys/my_atomic-t.c +++ b/unittest/mysys/my_atomic-t.c @@ -35,9 +35,6 @@ pthread_handler_t test_atomic_add(void *arg) my_atomic_add32(&bad, -x); my_atomic_rwlock_wrunlock(&rwl); } - pthread_mutex_lock(&mutex); - if (!--running_threads) pthread_cond_signal(&cond); - pthread_mutex_unlock(&mutex); return 0; } @@ -58,13 +55,6 @@ pthread_handler_t test_atomic_add64(void *arg) my_atomic_add64(&a64, -x); my_atomic_rwlock_wrunlock(&rwl); } - pthread_mutex_lock(&mutex); - if (!--running_threads) - { - bad= (a64 != 0); - pthread_cond_signal(&cond); - } - pthread_mutex_unlock(&mutex); return 0; } @@ -108,9 +98,6 @@ pthread_handler_t test_atomic_fas(void *arg) my_atomic_add32(&bad, -x); my_atomic_rwlock_wrunlock(&rwl); - pthread_mutex_lock(&mutex); - if (!--running_threads) pthread_cond_signal(&cond); - pthread_mutex_unlock(&mutex); return 0; } @@ -140,9 +127,6 @@ pthread_handler_t test_atomic_cas(void *arg) my_atomic_rwlock_wrunlock(&rwl); } while (!ok) ; } - pthread_mutex_lock(&mutex); - if (!--running_threads) pthread_cond_signal(&cond); - pthread_mutex_unlock(&mutex); return 0; } @@ -178,6 +162,7 @@ void do_tests() } a64=0; test_concurrently("my_atomic_add64", test_atomic_add64, THREADS, CYCLES); + bad= (a64 != 0); my_atomic_rwlock_destroy(&rwl); } -- cgit v1.2.1