[libstdc++] Fix test timeout in stop_calback/destroy.cc
authorThomas Rodgers <rodgert@twrodgers.com>
Wed, 21 Apr 2021 17:01:06 +0000 (10:01 -0700)
committerThomas Rodgers <rodgert@twrodgers.com>
Wed, 21 Apr 2021 20:28:08 +0000 (13:28 -0700)
commit7eeb8c04e53fa880ee559efb727517ce778d17a0
tree621519737fb1cff7636225ea7364b6b25f6244f8
parenta44895ce7ffbc26b4d765c40b5b346f8c9a9b762
[libstdc++] Fix test timeout in stop_calback/destroy.cc

A change was made to __atomic_semaphore::_S_do_try_acquire() to
(ideally) let the compare_exchange reload the value of __old rather than
always reloading it twice. This causes _M_acquire to spin indefinitely
if the value of __old is already 0.

libstdc++-v3/ChangeLog:
* include/bits/semaphore_base.h: Always reload __old in
__atomic_semaphore::_S_do_try_acquire().
* testsuite/30_threads/stop_token/stop_callback/destroy.cc:
re-enable testcase.
libstdc++-v3/include/bits/semaphore_base.h
libstdc++-v3/testsuite/30_threads/stop_token/stop_callback/destroy.cc