Fix data race in a list referenced by A.aa (gctest)
authorIvan Maidanski <ivmai@mail.ru>
Fri, 3 Nov 2017 17:08:09 +0000 (20:08 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 3 Nov 2017 17:08:09 +0000 (20:08 +0300)
commit8f5746e507098ad505af194d385d756675e26a90
treef23c7068eec6fe0d5f11054438add5856b3f104e
parent8acc13755db635d7c8244279bd2a20ad68e48cc0
Fix data race in a list referenced by A.aa (gctest)

* tests/test.c [!AO_HAVE_load] (AO_load): Remove macro.
* tests/test.c [!AO_HAVE_store] (AO_store): Likewise.
* tests/test.c [!AO_HAVE_load_acquire] (AO_load_acquire): New static
function (which uses FINALIZER_LOCK/FINALIZER_UNLOCK).
* tests/test.c [!AO_HAVE_store_release] (AO_store_release): New macro
(which uses FINALIZER_LOCK/FINALIZER_UNLOCK).
* tests/test.c [!AO_HAVE_fetch_and_add1] (AO_fetch_and_add1): Add
comment.
* tests/test.c (a_set): Use AO_store_release() instead of AO_store().
* tests/test.c (a_get): Use AO_load_acquire() instead of AO_load().
* tests/test.c (reverse_test_inner): Improve comment about thread
safety of a_set(reverse(reverse(a_get()))).
tests/test.c