summaryrefslogtreecommitdiff
path: root/sql/threadpool_unix.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-04-15 15:09:22 +0200
committerSergei Golubchik <sergii@pisem.net>2013-04-15 15:09:22 +0200
commita9035be5b7a7b3865ddb4ef34a5d0cfc65dfc254 (patch)
treea9df7341e91623f62fe37cd47fce139d8888fc95 /sql/threadpool_unix.cc
parent3a1c91d87d69ef243b3e78be6089102cafef0a8e (diff)
parentf57ecb7786177e0af3b1e3ec94302720b2e0f967 (diff)
downloadmariadb-git-a9035be5b7a7b3865ddb4ef34a5d0cfc65dfc254.tar.gz
10.0-base merge
Diffstat (limited to 'sql/threadpool_unix.cc')
-rw-r--r--sql/threadpool_unix.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc
index 13deb167d9b..69df00a2c9a 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;
}