nCine::Mutex class

Mutex for thread synchronization.

Wraps a platform mutex (a critical section on Windows, a pthread_mutex_t otherwise). Non-copyable. Used together with CondVariable for condition waiting.

Constructors, destructors, conversion operators

Mutex()
~Mutex()
Mutex(const Mutex&) deleted

Public functions

auto operator=(const Mutex&) -> Mutex& deleted
void Lock()
Acquires the lock, blocking until it becomes available.
void Unlock()
Releases the lock.
auto TryLock() -> int
Tries to acquire the lock without blocking, returning zero on success.