aboutsummaryrefslogtreecommitdiff
path: root/gcc/function-abi.h
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2025-10-24 11:38:22 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2025-10-28 16:07:41 +0000
commit14f7cfd292f18d9f83a9d4f36338b2399ad79a59 (patch)
tree42949e856d1b0c0d0467b23d805d87690300df7b /gcc/function-abi.h
parent162ec539a39c0b24eea3e17863499aa3f89d6a64 (diff)
downloadgcc-master.zip
gcc-master.tar.gz
gcc-master.tar.bz2
libstdc++: Fix deadlock in shared_timed_mutex test [PR122401]HEADtrunkmaster
The test_shared_relative function deadlocks on older Glibc versions that don't have pthread_rwlock_clockrdlock, because (as already mentioned earlier in the test file) pthread_rwlock_timedrdlock returns EDEADLK if the thread that already holds a write lock attempts to acquire read lock, causing std::shared_timed_mutex to loop forever. The fix is to do the invalid try_lock_shared_for call on a different thread. To avoid undefined behaviour, we need to make the same changes to all calls that try to acquire a lock that is already held. Also add missing -pthread for PR122401. libstdc++-v3/ChangeLog: PR libstdc++/122401 * testsuite/30_threads/shared_timed_mutex/try_lock_until/116586.cc: Do not try to acquire locks on the thread that already holds a lock. Add -pthread for et pthread. Reviewed-by: Mike Crowe <mac@mcrowe.com> Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
Diffstat (limited to 'gcc/function-abi.h')
0 files changed, 0 insertions, 0 deletions