Hash :
8c5f6314
Author :
Date :
2023-11-10T19:01:40
tests: In multithreaded tests, use random() instead of rand(). * tests/test-asyncsafe-spin2.c (random_account, lock_mutator_thread): Use random() instead of rand(). * tests/test-lock.c (random_account, lock_mutator_thread, rwlock_mutator_thread, recshuffle): Likewise. * tests/test-mtx.c (random_account, lock_mutator_thread, recshuffle): Likewise. * tests/test-pthread-mutex.c (random_account, lock_mutator_thread, recshuffle): Likewise. * tests/test-pthread-rwlock.c (random_account, rwlock_mutator_thread): Likewise. * tests/test-pthread-spin.c (random_account, lock_mutator_thread): Likewise. * tests/test-pthread-tss.c (perhaps_yield, worker_thread, racecheck_thread): Likewise. * tests/test-thread_local.c (perhaps_yield, worker_thread): Likewise. * tests/test-tls.c (perhaps_yield, worker_thread, racecheck_thread): Likewise. * tests/test-tss.c (perhaps_yield, worker_thread, racecheck_thread): Likewise. * asyncsafe-spin-tests (Depends-on): Add random. * lock-tests (Depends-on): Likewise. * mtx-tests (Depends-on): Likewise. * pthread-mutex-tests (Depends-on): Likewise. * pthread-rwlock-tests (Depends-on): Likewise. * pthread-spin-tests (Depends-on): Likewise. * pthread-tss-tests (Depends-on): Likewise. * threads-h-tests (Depends-on): Likewise. * tls-tests (Depends-on): Likewise. * tss-tests (Depends-on): Likewise.
Files:
tests/test-pthread-spin.c
tests/atomic-int-posix.h
tests/macros.h
m4/semaphore.m4
Depends-on:
pthread-thread
pthread-mutex
sched_yield
random
configure.ac:
AC_CHECK_HEADERS_ONCE([semaphore.h])
AC_CHECK_DECLS_ONCE([alarm])
AC_REQUIRE([gl_SEMAPHORE])
Makefile.am:
TESTS += test-pthread-spin
check_PROGRAMS += test-pthread-spin
test_pthread_spin_LDADD = $(LDADD) @LIBPMULTITHREAD@ @SCHED_YIELD_LIB@ @LIB_SEMAPHORE@