Eliminate data race in cons() of test_malloc
authorIvan Maidanski <ivmai@mail.ru>
Tue, 28 Nov 2017 08:06:36 +0000 (11:06 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 30 Nov 2017 15:51:51 +0000 (18:51 +0300)
commita4232e735bcefa11dbdf83a0a499a944fe04d5e9
tree153ee4e1337f58331dba9c0456a800b8edfc62e9
parentf5acd957181029de72b9d117d0785b98365f20eb
Eliminate data race in cons() of test_malloc
(fix commit c058d9d)

The data race has not affected the functionality of the test but this
commit allows to avoid no_sanitize attribute for the function.

* tests/test_malloc.c (cons): Remove AO_ATTR_NO_SANITIZE_THREAD
attribute; Do not reset extra (use "%" operator to get my_extra value).
* tests/test_malloc.c [AO_HAVE_fetch_and_add1] (cons): Change type of
extra to AO_t, add volatile qualifier; use AO_fetch_and_add1 instead of
"++" operator to update extra.
tests/test_malloc.c