]> granicus.if.org Git - gc/commit
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, 15 Dec 2017 17:43:26 +0000 (20:43 +0300)
commit2f1b8e8b7eff246e21e472f6c84ae7265f997105
treecb9bbafefa3524ab046ad1a42aa72da600e2074c
parent4e7927886ef1b1b76b1dc09c1acfe49a2d24ba5e
Fix data race in a list referenced by A.aa (gctest)
(Cherry-pick commits 8f5746e0f5a88d from 'master' branch.)

* 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): Likewise.
* 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