2022-12-28 23:44:45 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: AuMutex.Linux.hpp
|
|
|
|
Date: 2022-12-28
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Aurora::Threading::Primitives
|
|
|
|
{
|
|
|
|
struct Mutex : IWaitable
|
|
|
|
{
|
|
|
|
Mutex();
|
|
|
|
~Mutex();
|
|
|
|
|
|
|
|
bool HasOSHandle(AuMach &mach) override;
|
|
|
|
bool TryLock() override;
|
|
|
|
bool HasLockImplementation() override;
|
|
|
|
void Lock() override;
|
|
|
|
bool Lock(AuUInt64 timeout) override;
|
2023-03-12 15:27:28 +00:00
|
|
|
bool LockNS(AuUInt64 timeout) override;
|
2022-12-28 23:44:45 +00:00
|
|
|
void Unlock() override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
AuUInt32 value_ {};
|
|
|
|
};
|
|
|
|
}
|