diff options
| author | Jonathan Wakely <jwakely@redhat.com> | 2025-10-24 11:38:22 +0100 |
|---|---|---|
| committer | Jonathan Wakely <redi@gcc.gnu.org> | 2025-10-28 16:07:41 +0000 |
| commit | 14f7cfd292f18d9f83a9d4f36338b2399ad79a59 (patch) | |
| tree | 42949e856d1b0c0d0467b23d805d87690300df7b /gcc/function-abi.h | |
| parent | 162ec539a39c0b24eea3e17863499aa3f89d6a64 (diff) | |
| download | gcc-master.zip gcc-master.tar.gz gcc-master.tar.bz2 | |
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
