1 #include "hmbdc/Copyright.hpp" 3 #include "hmbdc/pattern/GuardedSingleton.hpp" 4 #include "hmbdc/Config.hpp" 5 #include "hmbdc/Compile.hpp" 9 namespace hmbdc {
namespace app {
namespace utils {
14 void add(uint32_t events,
EpollFd&);
20 EpollTask(
size_t maxFdCount = HMBDC_EPOLL_FD_MAX);
29 extern std::unique_ptr<hmbdc::pattern::SingletonGuardian<hmbdc::app::utils::EpollTask>> gEpollTaskGuard;
37 , fdReadyLocal_(
false)
43 utils::EpollTask::instance().del(*
this);
49 if (hmbdc_likely(fdReadyLocal_)) {
53 return fdReadyLocal_ = __atomic_exchange_n(&fdReady_,
false, __ATOMIC_RELAXED);
58 fdReadyLocal_ =
false;
59 if (errno != EAGAIN) {
60 if (!utils::EpollTask::instance().del(*
this)) {
base for the Singleton that works with SingletonGuardian
Definition: GuardedSingleton.hpp:35
RAII representing the lifespan of the underlying Singleton which also ganrantees the singularity of u...
Definition: GuardedSingleton.hpp:20
Definition: EpollTask.hpp:12
Definition: EpollTask.hpp:31