AuroraRuntime/Source/IO/Loop/LSFromFdNonblocking.hpp

21 lines
509 B
C++
Raw Normal View History

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: LSFromFdNonblocking.cpp
2022-04-05 05:59:23 +00:00
Date: 2022-4-5
Author: Reece
***/
#pragma once
namespace Aurora::IO::Loop
{
template<typename T>
inline bool IsSignaledFromNonblockingImpl(ILoopSourceEx *source, T * that, bool(T::*IsSignaledNonblocking)())
{
bool val {};
source->OnPresleep();
val = ((that)->*(IsSignaledNonblocking))();
source->OnFinishSleep();
return val;
}
}