summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/30_threads/semaphore/try_acquire_until.cc
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright years.Jakub Jelinek2023-01-161-1/+1
|
* Update copyright years.Jakub Jelinek2022-01-031-1/+1
|
* libstdc++: Fix semaphore to work with system_clock timeoutsJonathan Wakely2021-04-221-2/+0
| | | | | | | | | | | | | | | | | | | | The __cond_wait_until_impl function takes a steady_clock timeout, but then sometimes tries to compare it to a time from the system_clock, which won't compile. Additionally, that function gets called with system_clock timeouts, which also won't compile. This makes the function accept timeouts for either clock, and compare to the time from the right clock. This fixes the compilation error that was causing two tests to fail on non-futex targets, so we can revert the r12-11 change to disable them. libstdc++-v3/ChangeLog: * include/bits/atomic_timed_wait.h (__cond_wait_until_impl): Handle system_clock as well as steady_clock. * testsuite/30_threads/semaphore/try_acquire_for.cc: Re-enable. * testsuite/30_threads/semaphore/try_acquire_until.cc: Re-enable.
* libstdc++: Disable tests that fail after atomic wait/notify rewriteJonathan Wakely2021-04-201-0/+2
| | | | | | | | | | | | | These tests are currently failing, but should be analyzed and re-enabled. libstdc++-v3/ChangeLog: * testsuite/30_threads/semaphore/try_acquire_for.cc: Disable test for targets not using futexes for semaphores. * testsuite/30_threads/semaphore/try_acquire_until.cc: Likewise. * testsuite/30_threads/stop_token/stop_callback/destroy.cc: Disable for all targets.
* Add options to link with libatomic in various tests.John David Anglin2021-03-101-0/+1
| | | | | | | | | | | | | | | | | | libstdc++-v3/ChangeLog: * testsuite/29_atomics/atomic/wait_notify/bool.cc: Add options to link with libatomic. * testsuite/29_atomics/atomic/wait_notify/generic.cc: Likewise. * testsuite/29_atomics/atomic/wait_notify/pointers.cc: Likewise. * testsuite/29_atomics/atomic_flag/wait_notify/1.cc: Likewise. * testsuite/30_threads/barrier/arrive.cc: Likewise. * testsuite/30_threads/barrier/arrive_and_drop.cc: Likewise. * testsuite/30_threads/barrier/arrive_and_wait.cc: Likewise. * testsuite/30_threads/barrier/completion.cc: Likewise. * testsuite/30_threads/latch/3.cc: Likewise. * testsuite/30_threads/semaphore/try_acquire.cc: Likewise. * testsuite/30_threads/semaphore/try_acquire_for.cc: Likewise. * testsuite/30_threads/semaphore/try_acquire_until.cc: Likewise.
* Update copyright years.Jakub Jelinek2021-01-041-1/+1
|
* libstdc++: Fix handling of futex wake [PR 97936]Jonathan Wakely2020-11-251-1/+0
| | | | | | | | | | | | | | | | 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.
* libstdc++: Disable failing tests [PR 97936]Jonathan Wakely2020-11-241-2/+3
| | | | | | | | | | | | | | | | These tests are unstable and causing failures due to timeouts. Disable them until the cause can be found, so that testing doesn't have to wait for them to timeout. libstdc++-v3/ChangeLog: PR libstdc++/97936 PR libstdc++/97944 * testsuite/29_atomics/atomic_integral/wait_notify.cc: Disable. Do not require pthreads, but add -pthread when appropriate. * testsuite/30_threads/jthread/95989.cc: Likewise. * testsuite/30_threads/latch/3.cc: Likewise. * testsuite/30_threads/semaphore/try_acquire_until.cc: Likewise.
* libstdc++: Add C++2a synchronization supportThomas Rodgers2020-11-201-0/+94
Add support for - * atomic_flag::wait/notify_one/notify_all * atomic::wait/notify_one/notify_all * counting_semaphore * binary_semaphore * latch libstdc++-v3/ChangeLog: * include/Makefile.am (bits_headers): Add new header. * include/Makefile.in: Regenerate. * include/bits/atomic_base.h (__atomic_flag::wait): Define. (__atomic_flag::notify_one): Likewise. (__atomic_flag::notify_all): Likewise. (__atomic_base<_Itp>::wait): Likewise. (__atomic_base<_Itp>::notify_one): Likewise. (__atomic_base<_Itp>::notify_all): Likewise. (__atomic_base<_Ptp*>::wait): Likewise. (__atomic_base<_Ptp*>::notify_one): Likewise. (__atomic_base<_Ptp*>::notify_all): Likewise. (__atomic_impl::wait): Likewise. (__atomic_impl::notify_one): Likewise. (__atomic_impl::notify_all): Likewise. (__atomic_float<_Fp>::wait): Likewise. (__atomic_float<_Fp>::notify_one): Likewise. (__atomic_float<_Fp>::notify_all): Likewise. (__atomic_ref<_Tp>::wait): Likewise. (__atomic_ref<_Tp>::notify_one): Likewise. (__atomic_ref<_Tp>::notify_all): Likewise. (atomic_wait<_Tp>): Likewise. (atomic_wait_explicit<_Tp>): Likewise. (atomic_notify_one<_Tp>): Likewise. (atomic_notify_all<_Tp>): Likewise. * include/bits/atomic_wait.h: New file. * include/bits/atomic_timed_wait.h: New file. * include/bits/semaphore_base.h: New file. * include/std/atomic (atomic<bool>::wait): Define. (atomic<bool>::wait_one): Likewise. (atomic<bool>::wait_all): Likewise. (atomic<_Tp>::wait): Likewise. (atomic<_Tp>::wait_one): Likewise. (atomic<_Tp>::wait_all): Likewise. (atomic<_Tp*>::wait): Likewise. (atomic<_Tp*>::wait_one): Likewise. (atomic<_Tp*>::wait_all): Likewise. * include/std/latch: New file. * include/std/semaphore: New file. * include/std/version: Add __cpp_lib_semaphore and __cpp_lib_latch defines. * testsuite/29_atomics/atomic/wait_notify/bool.cc: New test. * testsuite/29_atomics/atomic/wait_notify/pointers.cc: Likewise. * testsuite/29_atomics/atomic/wait_notify/generic.cc: Liekwise. * testsuite/29_atomics/atomic_flag/wait_notify/1.cc: Likewise. * testsuite/29_atomics/atomic_float/wait_notify.cc: Likewise. * testsuite/29_atomics/atomic_integral/wait_notify.cc: Likewise. * testsuite/29_atomics/atomic_ref/wait_notify.cc: Likewise. * testsuite/30_threads/semaphore/1.cc: New test. * testsuite/30_threads/semaphore/2.cc: Likewise. * testsuite/30_threads/semaphore/least_max_value_neg.cc: Likewise. * testsuite/30_threads/semaphore/try_acquire.cc: Likewise. * testsuite/30_threads/semaphore/try_acquire_for.cc: Likewise. * testsuite/30_threads/semaphore/try_acquire_posix.cc: Likewise. * testsuite/30_threads/semaphore/try_acquire_until.cc: Likewise. * testsuite/30_threads/latch/1.cc: New test. * testsuite/30_threads/latch/2.cc: New test. * testsuite/30_threads/latch/3.cc: New test. * testsuite/util/atomic/wait_notify_util.h: New File.