2021-06-27 21:25:29 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
2021-06-27 21:33:58 +00:00
|
|
|
File: ConditionEx.hpp
|
2021-06-27 21:25:29 +00:00
|
|
|
Date: 2021-6-11
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Aurora::Threading::Primitives
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
A comprehensive CV that does not strictly abide by typical assumptions. <br>
|
2023-01-15 06:05:22 +00:00
|
|
|
This object depends on the synchronization of primitives within our abstraction layer rather than the OS's implementation of condition variables. <br>
|
2023-07-25 11:25:22 +00:00
|
|
|
Note: Missing 'pWaitable's cannnot serve as an `atomic wait for while is [not] value` operation.
|
2023-01-15 06:05:22 +00:00
|
|
|
There are no legal use cases for this feature. It's just there.
|
2021-06-27 21:25:29 +00:00
|
|
|
*/
|
2022-06-01 21:49:38 +00:00
|
|
|
struct ConditionEx
|
2021-06-27 21:25:29 +00:00
|
|
|
{
|
|
|
|
virtual void WaitForSignal() = 0;
|
2023-07-25 11:38:49 +00:00
|
|
|
virtual void WaitForSignal(IWaitable *pWaitable) = 0;
|
|
|
|
virtual void WaitForSignal(const AuSPtr<IWaitable> &pWaitable) = 0;
|
|
|
|
|
2023-08-12 10:18:19 +00:00
|
|
|
virtual bool WaitForSignalNS(AuUInt64 uRelativeNanoseconds) = 0;
|
|
|
|
virtual bool WaitForSignalNS(IWaitable *pWaitable, AuUInt64 uRelativeNanoseconds) = 0;
|
|
|
|
virtual bool WaitForSignalNS(const AuSPtr<IWaitable> &pWaitable, AuUInt64 uRelativeNanoseconds) = 0;
|
2023-07-25 11:38:49 +00:00
|
|
|
|
2021-06-27 21:25:29 +00:00
|
|
|
virtual void Broadcast() = 0;
|
|
|
|
virtual void Signal() = 0;
|
|
|
|
};
|
2023-07-25 11:25:22 +00:00
|
|
|
|
2023-08-16 08:47:54 +00:00
|
|
|
AUKN_SHARED_SOO_NCM(FlexibleConditionVariable, ConditionEx, kPrimitiveSizeSemaphoreCV);
|
2021-06-27 21:25:29 +00:00
|
|
|
}
|