AuroraRuntime/Include/Aurora/Threading/Primitives/ConditionMutex.hpp
Reece Wilson 51a2816f3f [*] Merge GTK JS's branch fix for async shutdown
[+] 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.
2023-01-30 13:26:17 +00:00

25 lines
661 B
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: ConditionMutex.hpp
Date: 2021-6-9
Author: Reece
***/
#pragma once
namespace Aurora::Threading::Primitives
{
/**
A limited mutex specifically for condition variables.
This should be used with the traditional CV idiom of `lock(), while(cond) { cv.wait() }, unlock()`.
For other use cases, you should use the alternative mutex.
*/
struct IConditionMutex
{
virtual bool TryLock() = 0;
virtual void Lock() = 0;
virtual void Unlock() = 0;
};
AUKN_SHARED_API(ConditionMutex, IConditionMutex);
}