AuroraRuntime/Source/IO/Loop/LSLocalSemaphore.hpp
Jamie Reece Wilson 5cafefae5d [*] LSLocalSemaphore bug fix for scriptability. (TODO: reimpl like the event?)
[*] Fix: IO objects not using the explicit slow sync primitives.
Dunno how these werent refactored; then again, i never properly got around to finishing the factories for fast/slow io objects. In addition, some of these arent even accessed by the ILoopSource interface, so it's not as critical of a failure.
2024-07-30 17:53:58 +01:00

44 lines
1.0 KiB
C++

/***
Copyright (C) 2023 J Reece Wilson (a/k/a "Reece"). All rights reserved.
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;
bool IsSignaledNoSpinIfUserland() override;
ELoopSource GetType() override;
bool AddOne() override;
bool AddMany(AuUInt32 uCount) override;
virtual bool OnTrigger(AuUInt handle) override;
bool TryTakeNoSpin();
bool TryTakeSpin();
bool TryTake();
bool TryTakeWaitMS(AuUInt32 timeout);
void OnPresleep() override;
void OnFinishSleep() override;
void DoParanoia();
AuAUInt32 uAtomicSemaphore {};
AuAUInt32 uAtomicKernelSemaphore {};
};
}