libstdc++: Add C++2a synchronization support
authorThomas Rodgers <trodgers@redhat.com>
Fri, 20 Nov 2020 20:29:34 +0000 (12:29 -0800)
committerThomas Rodgers <trodgers@redhat.com>
Fri, 20 Nov 2020 22:40:18 +0000 (14:40 -0800)
commit83a1beee2766f01a1f46f81ed53f679419318942
tree91d590aea81ac38d24b814371ebe533d12d6cfa0
parent89d9c634dc5c10b499c23297ef70133066946790
libstdc++: Add C++2a synchronization support

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.
28 files changed:
libstdc++-v3/include/Makefile.am
libstdc++-v3/include/Makefile.in
libstdc++-v3/include/bits/atomic_base.h
libstdc++-v3/include/bits/atomic_timed_wait.h [new file with mode: 0644]
libstdc++-v3/include/bits/atomic_wait.h [new file with mode: 0644]
libstdc++-v3/include/bits/semaphore_base.h [new file with mode: 0644]
libstdc++-v3/include/std/atomic
libstdc++-v3/include/std/latch [new file with mode: 0644]
libstdc++-v3/include/std/semaphore [new file with mode: 0644]
libstdc++-v3/include/std/version
libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/bool.cc [new file with mode: 0644]
libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/generic.cc [new file with mode: 0644]
libstdc++-v3/testsuite/29_atomics/atomic/wait_notify/pointers.cc [new file with mode: 0644]
libstdc++-v3/testsuite/29_atomics/atomic_flag/wait_notify/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/29_atomics/atomic_float/wait_notify.cc [new file with mode: 0644]
libstdc++-v3/testsuite/29_atomics/atomic_integral/wait_notify.cc [new file with mode: 0644]
libstdc++-v3/testsuite/29_atomics/atomic_ref/wait_notify.cc [new file with mode: 0644]
libstdc++-v3/testsuite/30_threads/latch/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/30_threads/latch/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/30_threads/latch/3.cc [new file with mode: 0644]
libstdc++-v3/testsuite/30_threads/semaphore/1.cc [new file with mode: 0644]
libstdc++-v3/testsuite/30_threads/semaphore/2.cc [new file with mode: 0644]
libstdc++-v3/testsuite/30_threads/semaphore/least_max_value_neg.cc [new file with mode: 0644]
libstdc++-v3/testsuite/30_threads/semaphore/try_acquire.cc [new file with mode: 0644]
libstdc++-v3/testsuite/30_threads/semaphore/try_acquire_for.cc [new file with mode: 0644]
libstdc++-v3/testsuite/30_threads/semaphore/try_acquire_posix.cc [new file with mode: 0644]
libstdc++-v3/testsuite/30_threads/semaphore/try_acquire_until.cc [new file with mode: 0644]
libstdc++-v3/testsuite/util/atomic/wait_notify_util.h [new file with mode: 0644]