1 #include "hmbdc/Copyright.hpp"
3 #include "hmbdc/pattern/GuardedSingleton.hpp"
4 #include "hmbdc/Config.hpp"
5 #include "hmbdc/Compile.hpp"
13 #include <sys/epoll.h>
16 namespace hmbdc {
namespace app {
namespace utils {
19 #ifndef HMBDC_NO_EPOLL
24 EPOLLOUT = ::EPOLLOUT,
27 void add(uint32_t events,
EpollFd&);
33 EpollTask(
size_t maxFdCount = HMBDC_EPOLL_FD_MAX);
50 void add(uint32_t events, EpollFd&);
56 EpollTask(
size_t maxFdCount = HMBDC_EPOLL_FD_MAX);
68 extern std::unique_ptr<hmbdc::pattern::SingletonGuardian<hmbdc::app::utils::EpollTask>> gEpollTaskGuard;
76 , fdReadyLocal_(
false)
82 utils::EpollTask::instance().del(*
this);
88 if (hmbdc_likely(fdReadyLocal_)) {
92 return fdReadyLocal_ = __atomic_exchange_n(&fdReady_,
false, __ATOMIC_RELAXED);
97 fdReadyLocal_ =
false;
98 if (errno != EAGAIN) {
99 if (!utils::EpollTask::instance().del(*
this)) {
base for the Singleton that works with SingletonGuardian
Definition: GuardedSingleton.hpp:53
RAII representing the lifespan of the underlying Singleton which also ganrantees the singularity of u...
Definition: GuardedSingleton.hpp:20
Definition: EpollTask.hpp:20
Definition: EpollTask.hpp:70