From 2c37ace13164b0a261fd850a0d11f5af539e657a Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Tue, 19 Feb 2013 23:46:52 +0100 Subject: MDEV-4174 - Use kqueue for threadpool implementation on more BSD variants than just FreeBSD or OSX - i.e NetBSD, OpenBSD, DragonFly, etc. --- sql/threadpool_unix.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'sql/threadpool_unix.cc') diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc index e324fa697da..94251660e37 100644 --- a/sql/threadpool_unix.cc +++ b/sql/threadpool_unix.cc @@ -29,14 +29,14 @@ #ifdef __linux__ #include typedef struct epoll_event native_event; -#endif -#if defined (__FreeBSD__) || defined (__APPLE__) +#elif defined(HAVE_KQUEUE) #include typedef struct kevent native_event; -#endif -#if defined (__sun) +#elif defined (__sun) #include typedef port_event_t native_event; +#else +#error threadpool is not available on this platform #endif /** Maximum number of native events a listener can read in one go */ @@ -285,7 +285,7 @@ static void *native_event_get_userdata(native_event *event) return event->data.ptr; } -#elif defined (__FreeBSD__) || defined (__APPLE__) +#elif defined(HAVE_KQUEUE) int io_poll_create() { return kqueue(); @@ -386,8 +386,6 @@ static void* native_event_get_userdata(native_event *event) { return event->portev_user; } -#else -#error not ported yet to this OS #endif -- cgit v1.2.1