#include "spinlock.hpp"
|
| constexpr | spinlockbase () noexcept |
| | spinlockbase (const spinlockbase &)=delete |
| constexpr | spinlockbase (spinlockbase &&) noexcept |
| | Atomically move constructs.
|
| | ~spinlockbase () |
| spinlockbase & | operator= (const spinlockbase &)=delete |
| spinlockbase & | operator= (spinlockbase &&)=delete |
| constexpr T | load (memory_order o=memory_order_seq_cst) const noexcept |
| | Returns the raw atomic.
|
| void | store (T a, memory_order o=memory_order_seq_cst) noexcept |
| | Sets the raw atomic.
|
| bool | try_lock () noexcept |
| | If atomic is zero, sets to 1 and returns true, else false.
|
| constexpr bool | try_lock () const noexcept |
| bool | try_lock (T &expected) noexcept |
| | If atomic equals expected, sets to 1 and returns true, else false with expected updated to actual value.
|
| void | unlock () noexcept |
| | Sets the atomic to zero.
|
| constexpr bool | int_yield (size_t) noexcept |
◆ value_type
◆ spinlockbase() [1/3]
153 {
155#if QUICKCPPLIB_IN_THREAD_SANITIZER
157#endif
158 }
#define QUICKCPPLIB_ANNOTATE_RWLOCK_CREATE(p)
Definition config.hpp:102
Definition spinlock.hpp:141
atomic< T > v
Definition spinlock.hpp:143
◆ spinlockbase() [2/3]
◆ spinlockbase() [3/3]
Atomically move constructs.
166 {
168
169#if QUICKCPPLIB_IN_THREAD_SANITIZER
171#endif
172 }
◆ ~spinlockbase()
174 {
175#ifdef QUICKCPPLIB_ENABLE_VALGRIND
177 {
179 }
180#endif
182 }
#define QUICKCPPLIB_ANNOTATE_RWLOCK_DESTROY(p)
Definition config.hpp:103
#define QUICKCPPLIB_ANNOTATE_RWLOCK_RELEASED(p, s)
Definition config.hpp:105
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ load()
◆ store()
◆ try_lock() [1/3]
If atomic is zero, sets to 1 and returns true, else false.
191 {
192#if !QUICKCPPLIB_IN_THREAD_SANITIZER
193#ifdef QUICKCPPLIB_USE_VOLATILE_READ_FOR_AVOIDING_CMPXCHG
194
195 volatile T *
_v = (
volatile T *) &
v;
197 return false;
198#else
200 return false;
201#endif
202#endif
203#if 0
204
205
208#else
212#endif
213 {
215 return true;
216 }
217 else return false;
218 }
#define QUICKCPPLIB_ANNOTATE_RWLOCK_ACQUIRED(p, s)
Definition config.hpp:104
◆ try_lock() [2/3]
◆ try_lock() [3/3]
If atomic equals expected, sets to 1 and returns true, else false with expected updated to actual value.
225 {
227#if !QUICKCPPLIB_IN_THREAD_SANITIZER
228#ifdef QUICKCPPLIB_USE_VOLATILE_READ_FOR_AVOIDING_CMPXCHG
229
230 volatile T *
_v = (
volatile T *) &
v;
232#else
235#endif
236 {
238 return false;
239 }
240#endif
243 {
245 return true;
246 }
247 else
248 return false;
249 }
◆ unlock()
◆ int_yield()
The documentation for this struct was generated from the following file: