]> Savannah Git Hosting - gnulib.git/commit
lock test: Fix performance problem on multi-core machines.
authorBruno Haible <bruno@clisp.org>
Sat, 24 Dec 2016 17:21:59 +0000 (18:21 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 24 Dec 2016 17:23:45 +0000 (18:23 +0100)
commit480d374e596a0ee3fed168ab42cd84c313ad3c89
tree7762e7cb7992c65aec30d76faca720c73d1d3002
parentd00d3c0cdb4a794b6f94a6c7105376e48dd53c80
lock test: Fix performance problem on multi-core machines.

* tests/test-lock.c (USE_VOLATILE): New macro.
(struct atomic_int): New type.
(init_atomic_int, get_atomic_int_value, set_atomic_int_value): New
functions.
(lock_checker_done, rwlock_checker_done, reclock_checker_done): Define
as 'struct atomic_int'.
(lock_checker_thread, test_lock, rwlock_checker_thread, test_rwlock,
reclock_checker_thread, test_recursive_lock): Use the new functions.
Reported by Eric Blake in
https://www.redhat.com/archives/libvir-list/2012-March/msg00854.html
and by Pádraig Brady in
http://lists.gnu.org/archive/html/bug-gnulib/2016-12/msg00117.html.
ChangeLog
tests/test-lock.c