AuroraRuntime/Source/Loop/LSSemaphore.Linux.hpp

29 lines
629 B
C++

/***
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: LSSemaphore.Linux.hpp
Date: 2022-4-5
Author: Reece
***/
#pragma once
#include "LSHandle.hpp"
namespace Aurora::Loop
{
struct LSSemaphore : public ILSSemaphore, public LSHandle
{
LSSemaphore(AuUInt32 initialCount);
~LSSemaphore();
bool AddOne() override;
virtual bool OnTrigger(AuUInt handle) override;
bool IsSignaled() override;
virtual ELoopSource GetType() override;
private:
void Init(AuUInt32 initialCount);
bool IsSignaledNonblocking();
};
}