|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
原子快速用户态互斥锁类模板 更多...
#include <atomic_futex.hpp>
Public 成员函数 | |
| constexpr | atomic_futex (const uint32_t data) |
| 构造函数 | |
| uint32_t | load (const memory_order mo) const noexcept |
| 原子加载数据 | |
| uint32_t | load_when_not_equal (const uint32_t value, const memory_order mo) |
| 等待直到值不等于指定值 | |
| void | load_when_equal (const uint32_t value, const memory_order mo) |
| 等待直到值等于指定值 | |
| template<typename Rep, typename Period> | |
| bool | load_when_equal_for (const uint32_t value, const memory_order mo, const duration< Rep, Period > &rtime) |
| 在指定时间内等待值等于指定值 | |
| template<typename Clock, typename Dur> | |
| bool | load_when_equal_until (const uint32_t value, const memory_order mo, const time_point< Clock, Dur > &atime) |
| 在指定时间点前等待值等于指定值(通用时钟) | |
| template<typename Dur> | |
| bool | load_when_equal_until (const uint32_t value, const memory_order mo, const time_point< system_clock, Dur > &atime) |
| 在指定时间点前等待值等于指定值(系统时钟) | |
| template<typename Dur> | |
| bool | load_when_equal_until (const uint32_t value, const memory_order mo, const time_point< steady_clock, Dur > &atime) |
| 在指定时间点前等待值等于指定值(单调时钟) | |
| bool | compare_exchange_strong (uint32_t &expected, const uint32_t desired, const memory_order success, const memory_order failure) noexcept |
| 原子比较并交换 | |
| void | store_notify_all (const uint32_t value, const memory_order mo) noexcept |
| 存储新值并通知所有等待线程 | |
原子快速用户态互斥锁类模板
| WaiterBit | 等待者标志位,默认为0x80000000 |
基于FUTEX实现的用户态互斥锁, 提供高效的线程同步机制,减少不必要的上下文切换。
在文件 atomic_futex.hpp 第 37 行定义.
|
inlineexplicitconstexpr |
|
inlinenoexcept |
原子比较并交换
| expected | 期望值(必须包含 WaiterBit 的可能状态) |
| desired | 新值 |
| success | 成功时的内存顺序 |
| failure | 失败时的内存顺序 |
在文件 atomic_futex.hpp 第 275 行定义.
引用了 success.
被这些函数引用 once_flag::call_once.
|
inlinenodiscardnoexcept |
原子加载数据
| mo | 内存顺序 |
在文件 atomic_futex.hpp 第 152 行定义.
被这些函数引用 once_flag::call_once, load_when_equal(), load_when_equal_until(), load_when_equal_until() , 以及 load_when_not_equal().
|
inline |
|
inline |
在指定时间内等待值等于指定值
| Rep | 时间表示类型 |
| Period | 时间单位比例 |
| value | 期望相等的值 |
| mo | 内存顺序 |
| rtime | 相对超时时间 |
在文件 atomic_futex.hpp 第 197 行定义.
引用了 ceil(), load_when_equal_until() , 以及 steady_clock::now().
|
inline |
在指定时间点前等待值等于指定值(通用时钟)
| Clock | 时钟类型 |
| Dur | 持续时间类型 |
| value | 期望相等的值 |
| mo | 内存顺序 |
| atime | 绝对超时时间点 |
在文件 atomic_futex.hpp 第 215 行定义.
引用了 ceil(), load_when_equal_until() , 以及 steady_clock::now().
被这些函数引用 load_when_equal_for() , 以及 load_when_equal_until().
|
inline |
在指定时间点前等待值等于指定值(单调时钟)
| Dur | 持续时间类型 |
| value | 期望相等的值 |
| mo | 内存顺序 |
| atime | 绝对超时时间点(单调时钟) |
在文件 atomic_futex.hpp 第 256 行定义.
引用了 load().
|
inline |
在指定时间点前等待值等于指定值(系统时钟)
| Dur | 持续时间类型 |
| value | 期望相等的值 |
| mo | 内存顺序 |
| atime | 绝对超时时间点 |
在文件 atomic_futex.hpp 第 237 行定义.
引用了 load().
|
inline |
等待直到值不等于指定值
| value | 期望不相等的值 |
| mo | 内存顺序 |
阻塞当前线程,直到数据值不等于指定的值。
在文件 atomic_futex.hpp 第 164 行定义.
引用了 load().
被这些函数引用 once_flag::call_once.
|
inlinenoexcept |
存储新值并通知所有等待线程
| value | 要存储的值 |
| mo | 内存顺序 |
原子地存储新值,如果有等待线程,则唤醒所有等待线程。
在文件 atomic_futex.hpp 第 288 行定义.
引用了 futex_notify().
被这些函数引用 once_flag::call_once.