2021-06-27 21:25:29 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
2022-12-16 00:41:01 +00:00
|
|
|
File: AuConditionMutex.Unix.hpp
|
2021-06-27 21:25:29 +00:00
|
|
|
Date: 2021-6-12
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
2022-12-16 00:41:01 +00:00
|
|
|
#include "AuIConditionMutexEx.hpp"
|
2021-06-27 21:25:29 +00:00
|
|
|
|
|
|
|
namespace Aurora::Threading::Primitives
|
|
|
|
{
|
2023-08-19 10:41:37 +00:00
|
|
|
struct UnixConditionMutex final : IConditionMutexEx
|
2021-06-27 21:25:29 +00:00
|
|
|
{
|
|
|
|
UnixConditionMutex();
|
|
|
|
~UnixConditionMutex();
|
|
|
|
|
2023-01-30 13:26:17 +00:00
|
|
|
bool TryLock() override;
|
2021-06-27 21:25:29 +00:00
|
|
|
void Lock() override;
|
|
|
|
void Unlock() override;
|
|
|
|
AuUInt GetOSHandle() override;
|
|
|
|
|
|
|
|
private:
|
2022-12-28 23:44:45 +00:00
|
|
|
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;
|
|
|
|
}
|