summaryrefslogtreecommitdiff
path: root/src/threadengines
diff options
context:
space:
mode:
Diffstat (limited to 'src/threadengines')
-rw-r--r--src/threadengines/threadengine_pthread.cpp50
1 files changed, 28 insertions, 22 deletions
diff --git a/src/threadengines/threadengine_pthread.cpp b/src/threadengines/threadengine_pthread.cpp
index fcb4db444..6456d6df5 100644
--- a/src/threadengines/threadengine_pthread.cpp
+++ b/src/threadengines/threadengine_pthread.cpp
@@ -72,18 +72,21 @@ class ThreadSignalSocket : public EventHandler
eventfd_write(fd, 1);
}
- void HandleEvent(EventType et, int errornum)
+ void OnEventHandlerRead() CXX11_OVERRIDE
{
- if (et == EVENT_READ)
- {
- eventfd_t dummy;
- eventfd_read(fd, &dummy);
- parent->OnNotify();
- }
- else
- {
- ServerInstance->GlobalCulls.AddItem(this);
- }
+ eventfd_t dummy;
+ eventfd_read(fd, &dummy);
+ parent->OnNotify();
+ }
+
+ void OnEventHandlerWrite() CXX11_OVERRIDE
+ {
+ ServerInstance->GlobalCulls.AddItem(this);
+ }
+
+ void OnEventHandlerError(int errcode) CXX11_OVERRIDE
+ {
+ ThreadSignalSocket::OnEventHandlerWrite();
}
};
@@ -122,18 +125,21 @@ class ThreadSignalSocket : public EventHandler
write(send_fd, &dummy, 1);
}
- void HandleEvent(EventType et, int errornum)
+ void OnEventHandlerRead() CXX11_OVERRIDE
+ {
+ char dummy[128];
+ read(fd, dummy, 128);
+ parent->OnNotify();
+ }
+
+ void OnEventHandlerWrite() CXX11_OVERRIDE
+ {
+ ServerInstance->GlobalCulls.AddItem(this);
+ }
+
+ void OnEventHandlerError(int errcode) CXX11_OVERRIDE
{
- if (et == EVENT_READ)
- {
- char dummy[128];
- read(fd, dummy, 128);
- parent->OnNotify();
- }
- else
- {
- ServerInstance->GlobalCulls.AddItem(this);
- }
+ ThreadSignalSocket::OnEventHandlerWrite();
}
};