Reece
f559897b42
[-] Removed WorkerId_t typedef [*] Added shared support to some older threading apis that have yet to be updated
29 lines
956 B
C++
29 lines
956 B
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: ConditionVariable.hpp
|
|
Date: 2021-6-9
|
|
Author: Reece
|
|
***/
|
|
#pragma once
|
|
|
|
namespace Aurora::Threading::Primitives
|
|
{
|
|
/**
|
|
A standard conditional variable tied to IConditionalMutex <br>
|
|
Multiple conditionals may use a common IConditionalMutex. <br>
|
|
Unlike the POSIX standard, <br>
|
|
1) we define no waitable as illegal <br>
|
|
2) conditional variables may not rebind their mutex
|
|
*/
|
|
class IConditionVariable
|
|
{
|
|
public:
|
|
virtual AuSPtr<IConditionMutex> GetMutex() = 0;
|
|
virtual bool WaitForSignal(AuUInt32 timeout = 0) = 0;
|
|
virtual void Broadcast() = 0;
|
|
virtual void Signal() = 0;
|
|
};
|
|
|
|
AUKN_SHARED_API(ConditionVariable, IConditionVariable, const AuSPtr<IConditionMutex> &mutex);
|
|
} |