CyberEngineMkIII
|
A fast locking, no order guaranteed, mutex. More...
#include <Mutex.hpp>
Public Types | |
using | Constructor = Interop::EmptyConstructor |
See Interop Construction. More... | |
![]() | |
enum | ID { ID::NULL_ID, ID::File, ID::Mutex, ID::Path, ID::Semaphore } |
Defines the IDs of allocatable engine objects. More... | |
using | Constructor = NullConstructor |
Override in descendants. | |
using | CopyConstructor = NullConstructor |
Override in descendants. | |
Public Member Functions | |
virtual | ~Mutex ()=default |
Destroy a Mutex. Mutex must be unlocked. | |
virtual void | Lock (void) noexcept=0 |
Acquire a lock on a Mutex. This will block the current thread until the lock is aquired. The Mutex must not be owned by the current thread. More... | |
virtual bool | TryLock (void) noexcept=0 |
Attempt to acquire a lock on a Mutex. This will not block the current thread. The Mutex must not be owned by the current thread. More... | |
virtual void | Unlock (void) noexcept=0 |
Release a lock on a Mutex. Should only be called after a Lock or TryLock on the same Mutex was aquired in the same thread. More... | |
![]() | |
virtual | ~Allocatable ()=default |
See Default Constructors and Destructor. | |
Additional Inherited Members | |
![]() | |
template<class AParent > | |
static constexpr ID | GetID (void) |
Returns the ID of an allocatable object. More... | |
A fast locking, no order guaranteed, mutex.
See Interop Construction.
CYB::Exception::SystemData | Error code: CYB::Exception::SystemData::MUTEX_INITIALIZATION_FAILURE Thrown if the mutex could not be initialized |
|
pure virtualnoexcept |
Acquire a lock on a Mutex. This will block the current thread until the lock is aquired. The Mutex must not be owned by the current thread.
Implemented in CYB::Platform::System::Mutex.
|
pure virtualnoexcept |
Attempt to acquire a lock on a Mutex. This will not block the current thread. The Mutex must not be owned by the current thread.
Implemented in CYB::Platform::System::Mutex.
|
pure virtualnoexcept |
Release a lock on a Mutex. Should only be called after a Lock or TryLock on the same Mutex was aquired in the same thread.
Implemented in CYB::Platform::System::Mutex.