CyberEngineMkIII
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
LockGuard.hpp
Go to the documentation of this file.
1 #pragma once
3 
4 namespace CYB {
5  namespace API {
7  class LockGuard {
8  private:
10  public:
18  LockGuard(Mutex& AMutex, const bool APreLocked = false) noexcept;
19  LockGuard(const LockGuard&) = delete;
20  LockGuard(LockGuard&& AMove) noexcept;
21  LockGuard& operator=(LockGuard&& AMove) noexcept;
22  ~LockGuard();
24 
30  void Release(void) noexcept;
31  };
32  }
33 }
34 
35 #include "LockGuard.inl"
A RAII locking mechanism.
Definition: LockGuard.hpp:7
Mutex * FMutex
A reference to the owned Mutex.
Definition: LockGuard.hpp:9
void Release(void) noexcept
Releases the lock on Mutex, this same LockGuard can never reaquire it.
A fast locking, no order guaranteed, mutex.
Definition: Mutex.hpp:10
LockGuard(Mutex &AMutex, const bool APreLocked=false) noexcept
Construct a LockGuard that will hold a lock on AMutex.