[Bug libstdc++/97936] [11 Regression] 30_threads/latch/3.cc hangs
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Nov 25 10:33:55 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97936
--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:
https://gcc.gnu.org/g:ad9cbcee543ecccd79fa49dafcd925532d2ce210
commit r11-5330-gad9cbcee543ecccd79fa49dafcd925532d2ce210
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Wed Nov 25 10:26:09 2020 +0000
libstdc++: Fix handling of futex wake [PR 97936]
The __platform_wait function is supposed to wait until *addr != old.
The futex syscall checks the initial value and returns EAGAIN if *addr
!= old is already true, which should cause __platform_wait to return.
Instead it loops and keeps doing a futex wait, which keeps returning
EAGAIN.
libstdc++-v3/ChangeLog:
PR libstdc++/97936
* include/bits/atomic_wait.h (__platform_wait): Return if futex
sets EAGAIN.
* testsuite/30_threads/latch/3.cc: Re-enable test.
* testsuite/30_threads/semaphore/try_acquire_until.cc: Likewise.
More information about the Gcc-bugs
mailing list