AuroraRuntime/Include/Aurora/Threading/Primitives/ConditionMutex.hpp
2021-06-27 22:25:29 +01:00

27 lines
911 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
{
/**
An extremely basic mutex primitive. <br>
This should be used with the traditional CV idiom of lock(), while(cond) { cv.wait() }, unlock() . <br>
For other use cases, you should use the alternative mutex. <br>
Note the usage of *should*; you could use this as a replacement to the standard mutex should there be no<br>
desire of the IWaitable interface.
*/
class IConditionMutex
{
public:
virtual void Lock() = 0;
virtual void Unlock() = 0;
};
AUKN_SHARED_API(ConditionMutex, IConditionMutex);
}