From 0fb5a016497d3061a6edf40752c06127f3abb796 Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Fri, 20 Apr 2012 07:42:10 +0200 Subject: Select polling mechanisms at one place This patch provides a single place for selecting polling mechanisms (polling.hpp). Up to now the selection was spread among the build system and several source files. Signed-off-by: Martin Sustrik --- src/io_thread.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/io_thread.cpp') diff --git a/src/io_thread.cpp b/src/io_thread.cpp index df5a623..c363592 100644 --- a/src/io_thread.cpp +++ b/src/io_thread.cpp @@ -21,6 +21,7 @@ #include "io_thread.hpp" #include "err.hpp" +#include "polling.hpp" #include "select.hpp" #include "poll.hpp" #include "epoll.hpp" @@ -30,15 +31,15 @@ xs::io_thread_t *xs::io_thread_t::create (xs::ctx_t *ctx_, uint32_t tid_) { io_thread_t *result; -#if defined XS_HAVE_SELECT +#if defined XS_USE_ASYNC_SELECT result = new (std::nothrow) select_t (ctx_, tid_); -#elif defined XS_HAVE_POLL +#elif defined XS_USE_ASYNC_POLL result = new (std::nothrow) poll_t (ctx_, tid_); -#elif defined XS_HAVE_EPOLL +#elif defined XS_USE_ASYNC_EPOLL result = new (std::nothrow) epoll_t (ctx_, tid_); -#elif defined XS_HAVE_DEVPOLL +#elif defined XS_USE_ASYNC_DEVPOLL result = new (std::nothrow) devpoll_t (ctx_, tid_); -#elif defined XS_HAVE_KQUEUE +#elif defined XS_USE_ASYNC_KQUEUE result = new (std::nothrow) kqueue_t (ctx_, tid_); #endif alloc_assert (result); -- cgit v1.2.3