|
Thread System 0.3.1
High-performance C++20 thread pool with work stealing and DAG scheduling
|
RAII wrapper to add wait/notify to atomic variables. More...
#include <atomic_wait.h>

Public Member Functions | |
| atomic_with_wait () noexcept | |
| atomic_with_wait (T initial) noexcept | |
| atomic_with_wait (const atomic_with_wait &)=delete | |
| atomic_with_wait & | operator= (const atomic_with_wait &)=delete |
| T | load (std::memory_order order=std::memory_order_seq_cst) const noexcept |
| void | store (T desired, std::memory_order order=std::memory_order_seq_cst) noexcept |
| T | exchange (T desired, std::memory_order order=std::memory_order_seq_cst) noexcept |
| bool | compare_exchange_weak (T &expected, T desired, std::memory_order order=std::memory_order_seq_cst) noexcept |
| bool | compare_exchange_strong (T &expected, T desired, std::memory_order order=std::memory_order_seq_cst) noexcept |
| void | wait (T old, std::memory_order order=std::memory_order_seq_cst) noexcept |
| void | notify_one () noexcept |
| void | notify_all () noexcept |
| operator T () const noexcept | |
| T | operator= (T desired) noexcept |
| template<typename U = T> | |
| std::enable_if< std::is_integral< U >::value, U >::type | fetch_add (T arg, std::memory_order order=std::memory_order_seq_cst) noexcept |
| template<typename U = T> | |
| std::enable_if< std::is_integral< U >::value, U >::type | fetch_sub (T arg, std::memory_order order=std::memory_order_seq_cst) noexcept |
| template<typename U = T> | |
| std::enable_if< std::is_integral< U >::value, U >::type | operator++ () noexcept |
| template<typename U = T> | |
| std::enable_if< std::is_integral< U >::value, U >::type | operator++ (int) noexcept |
| template<typename U = T> | |
| std::enable_if< std::is_integral< U >::value, U >::type | operator-- () noexcept |
| template<typename U = T> | |
| std::enable_if< std::is_integral< U >::value, U >::type | operator-- (int) noexcept |
Private Attributes | |
| std::atomic< T > | value_ |
| atomic_wait_helper< T > | waiter_ |
RAII wrapper to add wait/notify to atomic variables.
This class combines std::atomic with atomic_wait_helper to provide a drop-in replacement for C++20's atomic with wait/notify support.
| T | The value type |
Usage:
Definition at line 169 of file atomic_wait.h.
|
inlinenoexcept |
Definition at line 171 of file atomic_wait.h.
|
inlineexplicitnoexcept |
Definition at line 172 of file atomic_wait.h.
|
delete |
|
inlinenoexcept |
Definition at line 196 of file atomic_wait.h.
References kcenon::thread::atomic_with_wait< T >::value_.
|
inlinenoexcept |
Definition at line 191 of file atomic_wait.h.
References kcenon::thread::atomic_with_wait< T >::value_.
|
inlinenoexcept |
Definition at line 187 of file atomic_wait.h.
References kcenon::thread::atomic_with_wait< T >::value_.
|
inlinenoexcept |
Definition at line 266 of file atomic_wait.h.
References kcenon::thread::atomic_with_wait< T >::value_.
Referenced by kcenon::thread::atomic_with_wait< T >::operator++(), and kcenon::thread::atomic_with_wait< T >::operator++().

|
inlinenoexcept |
Definition at line 272 of file atomic_wait.h.
References kcenon::thread::atomic_with_wait< T >::value_.
Referenced by kcenon::thread::atomic_with_wait< T >::operator--(), and kcenon::thread::atomic_with_wait< T >::operator--().

|
inlinenoexcept |
Definition at line 179 of file atomic_wait.h.
References kcenon::thread::atomic_with_wait< T >::value_.
Referenced by kcenon::thread::atomic_with_wait< T >::operator T().

|
inlinenoexcept |
Definition at line 210 of file atomic_wait.h.
References kcenon::thread::atomic_with_wait< T >::waiter_.
|
inlinenoexcept |
Definition at line 206 of file atomic_wait.h.
References kcenon::thread::atomic_with_wait< T >::waiter_.
|
inlinenoexcept |
Definition at line 215 of file atomic_wait.h.
References kcenon::thread::atomic_with_wait< T >::load().

|
inlinenoexcept |
Definition at line 278 of file atomic_wait.h.
References kcenon::thread::atomic_with_wait< T >::fetch_add().

|
inlinenoexcept |
Definition at line 284 of file atomic_wait.h.
References kcenon::thread::atomic_with_wait< T >::fetch_add().

|
inlinenoexcept |
Definition at line 290 of file atomic_wait.h.
References kcenon::thread::atomic_with_wait< T >::fetch_sub().

|
inlinenoexcept |
Definition at line 296 of file atomic_wait.h.
References kcenon::thread::atomic_with_wait< T >::fetch_sub().

|
delete |
|
inlinenoexcept |
Definition at line 220 of file atomic_wait.h.
References kcenon::thread::atomic_with_wait< T >::store().

|
inlinenoexcept |
Definition at line 183 of file atomic_wait.h.
References kcenon::thread::atomic_with_wait< T >::value_.
Referenced by kcenon::thread::atomic_with_wait< T >::operator=().

|
inlinenoexcept |
Definition at line 202 of file atomic_wait.h.
References kcenon::thread::atomic_with_wait< T >::value_, and kcenon::thread::atomic_with_wait< T >::waiter_.
|
private |
Definition at line 302 of file atomic_wait.h.
Referenced by kcenon::thread::atomic_with_wait< T >::compare_exchange_strong(), kcenon::thread::atomic_with_wait< T >::compare_exchange_weak(), kcenon::thread::atomic_with_wait< T >::exchange(), kcenon::thread::atomic_with_wait< T >::fetch_add(), kcenon::thread::atomic_with_wait< T >::fetch_sub(), kcenon::thread::atomic_with_wait< T >::load(), kcenon::thread::atomic_with_wait< T >::store(), and kcenon::thread::atomic_with_wait< T >::wait().
|
private |
Definition at line 303 of file atomic_wait.h.
Referenced by kcenon::thread::atomic_with_wait< T >::notify_all(), kcenon::thread::atomic_with_wait< T >::notify_one(), and kcenon::thread::atomic_with_wait< T >::wait().