AuroraRuntime/Source/Threading/Primitives/AuConditionMutex.Unix.hpp

30 lines
679 B
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: AuConditionMutex.Unix.hpp
Date: 2021-6-12
Author: Reece
***/
#pragma once
#include "AuIConditionMutexEx.hpp"
namespace Aurora::Threading::Primitives
{
struct UnixConditionMutex final : IConditionMutexEx
{
UnixConditionMutex();
~UnixConditionMutex();
bool TryLock() override;
void Lock() override;
void Unlock() override;
AuUInt GetOSHandle() override;
private:
pthread_mutex_t value_;
};
using ConditionVariableInternal = UnixConditionMutex;
using ConditionMutexImpl = UnixConditionMutex;
}