#ifndef HEADER_MUTEX_H #define HEADER_MUTEX_H #include "Base.h" #include #ifdef CRU_WINDOWS #include #else #include #endif namespace cru { class CRU_API Mutex { public: Mutex(); Mutex(const Mutex &other) = delete; Mutex &operator=(const Mutex &other) = delete; Mutex(Mutex &&other); Mutex &operator=(Mutex &&other); ~Mutex(); public: void Lock(); bool TryLock(); void Unlock(); private: void Destroy(); private: #ifdef CRU_WINDOWS HANDLE handle_; #else std::unique_ptr mutex_; #endif }; } // namespace cru #endif