Futex-based mutex suitable for inter-process locking via shared memory.
More...
#include <futex.hpp>
Futex-based mutex suitable for inter-process locking via shared memory.
◆ SharedFutex() [1/3]
| join::SharedFutex::SharedFutex |
( |
| ) |
|
|
inlinenoexcept |
◆ SharedFutex() [2/3]
| join::SharedFutex::SharedFutex |
( |
const SharedFutex & | other | ) |
|
|
delete |
copy constructor.
- Parameters
-
| other | other object to copy. |
◆ SharedFutex() [3/3]
move constructor.
- Parameters
-
| other | other object to move. |
◆ ~SharedFutex()
| join::SharedFutex::~SharedFutex |
( |
| ) |
|
|
default |
◆ handle()
| std::atomic_uint32_t * join::SharedFutex::handle |
( |
| ) |
|
|
inlinenoexcept |
get a pointer to the underlying futex word.
- Returns
- pointer to the atomic futex word.
◆ lock()
| void join::SharedFutex::lock |
( |
| ) |
|
|
inlinenoexcept |
lock the futex, blocking until it becomes available.
◆ operator=() [1/2]
copy assignment.
- Parameters
-
| other | other object to copy. |
- Returns
- a reference to the current object.
◆ operator=() [2/2]
move assignment.
- Parameters
-
| other | other object to move. |
- Returns
- a reference to the current object.
◆ tryLock()
| bool join::SharedFutex::tryLock |
( |
| ) |
|
|
inlinenoexcept |
try to lock the futex without blocking.
- Returns
- true if the lock was acquired, false if it was already locked.
◆ unlock()
| void join::SharedFutex::unlock |
( |
| ) |
|
|
inlinenoexcept |
unlock the futex, waking one waiter if any.
The documentation for this class was generated from the following file: