| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
* m4/semaphore.m4: New file.
* modules/lock-tests (Files): Add it.
(configure.ac): Require gl_SEMAPHORE.
(Makefile.am): Link test-lock with $(LIB_SEMAPHORE).
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
* tests/test-once.c: New file.
* modules/lock-tests (Files): Add it.
(Makefile.am): Build and test programs 'test-once1' and 'test-once2'.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
* modules/lock-tests (test_rwlock1_LDADD): Add @YIELD_LIB@.
Reported by Tom G. Christensen <tgc@jupiterrise.com>.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
|
|