Mutex.hpp 587 B

123456789101112131415161718192021222324252627
  1. #ifndef CORE_MUTEX_HPP
  2. #define CORE_MUTEX_HPP
  3. #include "core/utils/AlignedData.hpp"
  4. #include "core/utils/Check.hpp"
  5. #include "core/utils/Error.hpp"
  6. namespace Core {
  7. class Mutex final {
  8. AlignedData<40, 8> mutex;
  9. public:
  10. Mutex();
  11. Mutex(const Mutex& other) = delete;
  12. Mutex(Mutex&& other) = delete;
  13. ~Mutex();
  14. Mutex& operator=(const Mutex& other) = delete;
  15. Mutex& operator=(Mutex&& other) = delete;
  16. check_return Error init();
  17. check_return Error lock();
  18. check_return Error unlock();
  19. };
  20. }
  21. #endif