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

30 lines
679 B
C++
Raw Normal View History

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