AuroraRuntime/Include/Aurora/Threading/Primitives/ConditionMutex.hpp
Reece 6974c713f7 [+] Allocationless thread primitives
[*] Rename SMPYield to SMTYield
2023-03-21 03:19:22 +00:00

25 lines
686 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_SOO(ConditionMutex, IConditionMutex, kPrimitiveSizeCondMutex);
}