2022-04-05 02:36:39 +00:00
|
|
|
/***
|
|
|
|
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
|
2022-04-05 02:36:39 +00:00
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
2022-06-11 23:52:46 +00:00
|
|
|
namespace Aurora::IO::Loop
|
2022-04-05 02:36:39 +00:00
|
|
|
{
|
|
|
|
template<typename T>
|
2022-04-05 10:11:19 +00:00
|
|
|
inline bool IsSignaledFromNonblockingImpl(ILoopSourceEx *source, T * that, bool(T::*IsSignaledNonblocking)())
|
2022-04-05 02:36:39 +00:00
|
|
|
{
|
|
|
|
bool val {};
|
|
|
|
source->OnPresleep();
|
2022-04-05 10:11:19 +00:00
|
|
|
val = ((that)->*(IsSignaledNonblocking))();
|
2022-04-05 02:36:39 +00:00
|
|
|
source->OnFinishSleep();
|
|
|
|
return val;
|
|
|
|
}
|
|
|
|
}
|