summaryrefslogtreecommitdiff
path: root/sql/threadpool_generic.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/threadpool_generic.cc')
-rw-r--r--sql/threadpool_generic.cc18
1 files changed, 6 insertions, 12 deletions
diff --git a/sql/threadpool_generic.cc b/sql/threadpool_generic.cc
index e84d96ace33..74b1a778647 100644
--- a/sql/threadpool_generic.cc
+++ b/sql/threadpool_generic.cc
@@ -13,7 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */
-#include <my_global.h>
+#include "mariadb.h"
#include <violite.h>
#include <sql_priv.h>
#include <sql_class.h>
@@ -63,9 +63,6 @@ typedef OVERLAPPED_ENTRY native_event;
#error threadpool is not available on this platform
#endif
-#ifdef _MSC_VER
-#pragma warning (disable : 4312)
-#endif
static void io_poll_close(TP_file_handle fd)
{
@@ -181,7 +178,7 @@ connection_queue_t;
const int NQUEUES=2; /* We have high and low priority queues*/
-struct thread_group_t
+struct MY_ALIGNED(CPU_LEVEL1_DCACHE_LINESIZE) thread_group_t
{
mysql_mutex_t mutex;
connection_queue_t queues[NQUEUES];
@@ -199,7 +196,7 @@ struct thread_group_t
int shutdown_pipe[2];
bool shutdown;
bool stalled;
-} MY_ALIGNED(CPU_LEVEL1_DCACHE_LINESIZE);
+};
static thread_group_t *all_groups;
static uint group_count;
@@ -594,11 +591,8 @@ static void timeout_check(pool_timer_t *timer)
THD *thd;
while ((thd=it++))
{
- if (thd->net.reading_or_writing != 1)
- continue;
-
TP_connection_generic *connection= (TP_connection_generic *)thd->event_scheduler.data;
- if (!connection)
+ if (!connection || connection->state != TP_STATE_IDLE)
{
/*
Connection does not have scheduler data. This happens for example
@@ -1505,7 +1499,7 @@ void TP_connection_generic::set_io_timeout(int timeout_sec)
}
-
+#ifndef HAVE_IOCP
/**
Handle a (rare) special case,where connection needs to
migrate to a different group because group_count has changed
@@ -1540,7 +1534,7 @@ static int change_group(TP_connection_generic *c,
mysql_mutex_unlock(&new_group->mutex);
return ret;
}
-
+#endif
int TP_connection_generic::start_io()
{