diff options
Diffstat (limited to 'sql/threadpool_unix.cc')
-rw-r--r-- | sql/threadpool_unix.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc index da38d64fa4d..94251660e37 100644 --- a/sql/threadpool_unix.cc +++ b/sql/threadpool_unix.cc @@ -29,14 +29,14 @@ #ifdef __linux__ #include <sys/epoll.h> typedef struct epoll_event native_event; -#endif -#if defined (__FreeBSD__) || defined (__APPLE__) +#elif defined(HAVE_KQUEUE) #include <sys/event.h> typedef struct kevent native_event; -#endif -#if defined (__sun) +#elif defined (__sun) #include <port.h> 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 @@ -1247,11 +1245,12 @@ static void connection_abort(connection_t *connection) DBUG_ENTER("connection_abort"); thread_group_t *group= connection->thread_group; + threadpool_remove_connection(connection->thd); + mysql_mutex_lock(&group->mutex); group->connection_count--; mysql_mutex_unlock(&group->mutex); - - threadpool_remove_connection(connection->thd); + my_free(connection); DBUG_VOID_RETURN; } |