Mutex with owner-thread reentry.
More...
#include <StormByte/thread_lock.hxx>
Mutex with owner-thread reentry.
The owning thread may call Lock() again without blocking. Another thread blocks in Lock() until the owner calls Unlock(). Unlock() from a thread that does not own the lock is a no-op.
◆ ThreadLock() [1/3]
| StormByte::ThreadLock::ThreadLock |
( |
| ) |
|
|
defaultnoexcept |
◆ ThreadLock() [2/3]
| StormByte::ThreadLock::ThreadLock |
( |
const ThreadLock & |
| ) |
|
|
delete |
◆ ThreadLock() [3/3]
| StormByte::ThreadLock::ThreadLock |
( |
ThreadLock && |
| ) |
|
|
delete |
Not movable (std::mutex is not movable on Windows).
◆ ~ThreadLock()
| StormByte::ThreadLock::~ThreadLock |
( |
| ) |
|
|
noexcept |
Releases internal mutexes.
- Note
- The owner should
Unlock() before destruction if it still holds the lock.
◆ Lock()
| void StormByte::ThreadLock::Lock |
( |
| ) |
|
|
noexcept |
Acquire the lock.
Returns immediately if this thread already owns it. Otherwise blocks until ownership is taken.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ Unlock()
| void StormByte::ThreadLock::Unlock |
( |
| ) |
|
|
noexcept |
Release ownership.
No-op if this thread is not the owner.
The documentation for this class was generated from the following file: