AuroraRuntime/Source/IO/Loop/LSLocalSemaphore.hpp

37 lines
809 B
C++
Raw Normal View History

/***
Copyright (C) 2023 J Reece Wilson (a/k/a "Reece"). All rights reserved.
2023-10-21 08:04:48 +00:00
File: LSLocalSemaphore.hpp
Date: 2023-10-21
Author: Reece
***/
#pragma once
#include "LSSemaphore.hpp"
namespace Aurora::IO::Loop
{
struct LSLocalSemaphore : LSSemaphore
{
LSLocalSemaphore();
~LSLocalSemaphore();
bool TryInit(AuUInt32 initialCount);
bool IsSignaled() override;
bool WaitOn(AuUInt32 timeout) override;
ELoopSource GetType() override;
bool AddOne() override;
virtual bool OnTrigger(AuUInt handle) override;
bool TryTakeNoSpin();
bool TryTakeSpin();
bool TryTake();
bool TryTakeWaitMS(AuUInt32 timeout);
AuAUInt32 uAtomicWord {};
AuAUInt32 uAtomicSemaphore {};
};
}