summaryrefslogtreecommitdiff
path: root/modules/lock-tests
Commit message (Collapse)AuthorAgeFilesLines
* tests: Refactor.Bruno Haible2020-07-011-0/+1
| | | | | | * tests/atomic-int-gnulib.h: New file, extracted from tests/test-lock.c. * tests/test-lock.c: Include it. Remove the corresponding code. * modules/lock-tests (Files): Add tests/atomic-int-gnulib.h.
* lock tests: Fix link error on HP-UX/hppa (regression from 2019-12-21).Bruno Haible2019-12-241-1/+3
| | | | | | | * m4/semaphore.m4: New file. * modules/lock-tests (Files): Add it. (configure.ac): Require gl_SEMAPHORE. (Makefile.am): Link test-lock with $(LIB_SEMAPHORE).
* lock tests: Prevent that the test takes too long.Bruno Haible2019-04-281-0/+1
| | | | | | * tests/test-lock.c: Include <signal.h>, <unistd.h>. (main): Let the test fail if it takes more than 10 minutes. * modules/lock-tests (configure.ac): Test whether 'alarm' is declared.
* Fix gcc warnings on 64-bit mode mingw.Bruno Haible2019-04-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/clean-temp.c: Include <stdint.h> instead of defining uintptr_t. * lib/gl_array_list.c: Likewise. * lib/gl_array_map.c: Likewise. * lib/gl_array_set.c: Likewise. * lib/gl_carray_list.c: Likewise. * lib/gl_sublist.c: Likewise. * lib/gl_avltreehash_list.c (uintptr_t): Remove definition. * lib/gl_rbtreehash_list.c (uintptr_t): Likewise. * lib/gl_hash_map.c (uintptr_t): Likewise. * lib/gl_hash_set.c (uintptr_t): Likewise. * lib/gl_linkedhash_list.c (uintptr_t): Likewise. * lib/gl_linkedhash_map.c (uintptr_t): Likewise. * lib/gl_linkedhash_set.c (uintptr_t): Likewise. * lib/iconv.c (uintptr_t): Likewise. * lib/iconv_close.c (uintptr_t): Likewise. * tests/test-lock.c: Include <stdint.h>. (once_contender_thread, test_once): Cast through 'intptr_t' instead of 'long'. * modules/clean-temp (Depends-on): Add stdint. * modules/array-list (Depends-on): Likewise. * modules/array-map (Depends-on): Likewise. * modules/array-set (Depends-on): Likewise. * modules/carray-list (Depends-on): Likewise. * modules/sublist (Depends-on): Likewise. * modules/lock-tests (Depends-on): Likewise.
* lock: Add test of gl_once.Bruno Haible2018-02-171-2/+7
| | | | | | * tests/test-once.c: New file. * modules/lock-tests (Files): Add it. (Makefile.am): Build and test programs 'test-once1' and 'test-once2'.
* lock tests: Fix build failure on z/OS.Bruno Haible2017-02-201-0/+1
| | | | | | | Reported by Daniel Richard G. <skunk@iskunk.org>. * modules/lock-tests (configure.ac): Test for <semaphore.h>. * tests/test-lock.c (USE_SEMAPHORE): Don't set if <semaphore.h> does not exist.
* lock tests: Fix link error.Bruno Haible2017-02-011-1/+1
| | | | | * modules/lock-tests (test_rwlock1_LDADD): Add @YIELD_LIB@. Reported by Tom G. Christensen <tgc@jupiterrise.com>.
* lock: Provide guarantee to avoid writer starvation for rwlocks.Bruno Haible2017-01-051-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rationale is: 1) Read-preferring read-write locks are prone to writer starvation if the number of reader threads multiplied by the percentage of time they have the lock held is too high. 2) Write- preferring read-write locks are the only reliable way to avoid this. 3) There have been reports of 'test-lock' hanging on glibc systems http://lists.gnu.org/archive/html/bug-gnulib/2017-01/msg00009.html, and glibc indeed implements read-preferring rwlocks by default, see http://man7.org/linux/man-pages/man3/pthread_rwlockattr_setkind_np.3.html and https://sourceware.org/bugzilla/show_bug.cgi?id=13701 . * m4/pthread_rwlock_rdlock.m4: New file. * m4/lock.m4 (gl_LOCK): Invoke gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER. * lib/glthread/lock.h [USE_POSIX_THREADS]: Test HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER. Use a different implementation of rwlock initialization on glibc systems without HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER. Use a different implementation of rwlocks altogether on non-glibc systems without HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER. [USE_PTH_THREADS]: Use a different implementation of rwlocks altogether. * lib/glthread/lock.c [USE_POSIX_THREADS] (glthread_rwlock_init_for_glibc): New function. [USE_POSIX_THREADS] (glthread_rwlock_rdlock_multithreaded): Update comment. [USE_PTH_THREADS]: New implementation of rwlocks. [USE_WINDOWS_THREADS] (glthread_rwlock_rdlock_func): Prefer writers over readers. * modules/lock (Files): Add m4/pthread_rwlock_rdlock.m4. (Depends-on): Add 'extensions'. * tests/test-rwlock1.c: New file. * lock-tests (Files): Add it. (Depends-on): Add usleep. (Makefile.am): Add test-rwlock1 to the tests.
* Make use of the modules 'thread', 'yield' in the 'lock' test.Bruno Haible2008-10-011-11/+3
|
* Undo unintentional commit.Bruno Haible2008-08-311-3/+11
|
* Avoid some "gcc -pedantic" warnings.Bruno Haible2008-08-301-11/+3
|
* Fix --with-tests compilation on cygwin.Eric Blake2007-04-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | * modules/argmatch-tests (Makefile.am): List gnulib library first in LDADD. * modules/argp-tests (Makefile.am): Likewise. * modules/array-list-tests (Makefile.am): Likewise. * modules/array-oset-tests (Makefile.am): Likewise. * modules/avltree-list-tests (Makefile.am): Likewise. * modules/avltree-oset-tests (Makefile.am): Likewise. * modules/avltreehash-list-tests (Makefile.am): Likewise. * modules/carray-list-tests (Makefile.am): Likewise. * modules/dirname-tests (Makefile.am): Likewise. * modules/frexp-tests (Makefile.am): Likewise. * modules/isnanl-tests (Makefile.am): Likewise. * modules/linked-list-tests (Makefile.am): Likewise. * modules/linkedhash-list-tests (Makefile.am): Likewise. * modules/lock-tests (Makefile.am): Likewise. * modules/rbtree-list-tests (Makefile.am): Likewise. * modules/rbtree-oset-tests (Makefile.am): Likewise. * modules/rbtreehash-list-tests (Makefile.am): Likewise. * modules/tls-tests (Makefile.am): Likewise. * modules/tsearch-tests (Makefile.am): Likewise. * modules/xvasprintf-tests (Makefile.am): Likewise.
* Try harder to find sched_yield on Solaris.Bruno Haible2007-04-131-1/+4
|
* Assume automake >= 1.10.Bruno Haible2007-02-251-1/+1
|
* * modules/xstrtod: Omit xstrtod.h, xstrtod.c; they're in LIB_SOURCES.Paul Eggert2006-02-251-1/+1
| | | | | | | | * modules/lock-tests (TESTS): Use $(EXEEXT). * modules/tls-tests: Likewise. * modules/argp-tests: Likewise. (check_PROGRAMS): New var, replacing... (noinst_PROGRAMS, test_argp_SOURCES): Remove.
* Simplify.Bruno Haible2006-01-231-2/+1
|
* Tests for gnulib module 'lock'.Bruno Haible2005-08-251-0/+20