Reece Wilson
51a2816f3f
[+] IConditionMutex::TryLock() ... Timed is still too much of an ask for this interface, i think. There's a good reason as to why this isn't a iwaitable. This condvar interface must be as common and primitive as possible.
29 lines
615 B
C++
29 lines
615 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 : IConditionMutexEx
|
|
{
|
|
UnixConditionMutex();
|
|
~UnixConditionMutex();
|
|
|
|
bool TryLock() override;
|
|
void Lock() override;
|
|
void Unlock() override;
|
|
AuUInt GetOSHandle() override;
|
|
|
|
private:
|
|
pthread_mutex_t value_;
|
|
};
|
|
|
|
using ConditionMutexImpl = UnixConditionMutex;
|
|
} |