summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFooBarrior <nikitamalyavin@gmail.com>2022-06-09 17:13:47 +0300
committerFooBarrior <nikitamalyavin@gmail.com>2022-06-09 17:13:47 +0300
commit3d00cbd4a155e14e409205ec2b49a226bd355fda (patch)
treebc732688fef5cb00e0d932de90621f8b447e5059
parent23b69539b016c94400ef26ef30ba86fbec53126a (diff)
downloadmariadb-git-bb-nikita-MDEV-16440.tar.gz
fix long tpool executionbb-nikita-MDEV-16440
-rw-r--r--sql/threadpool_common.cc4
-rw-r--r--sql/threadpool_win.cc6
2 files changed, 5 insertions, 5 deletions
diff --git a/sql/threadpool_common.cc b/sql/threadpool_common.cc
index 72897e5daad..d9a6fc75f41 100644
--- a/sql/threadpool_common.cc
+++ b/sql/threadpool_common.cc
@@ -666,9 +666,9 @@ static bool tp_notify_apc(THD *thd, THD *this_thd)
poll, then we will wait until the epoch change, therefore, will wait
until the task will reach the worker by the queue, which can be
long.
- So longer sleep here.
+ So longer sleep here (1ms).
*/
- sleep(1);
+ my_sleep(1000);
}
}
}
diff --git a/sql/threadpool_win.cc b/sql/threadpool_win.cc
index bb961cdf9e1..c9d202bb4fc 100644
--- a/sql/threadpool_win.cc
+++ b/sql/threadpool_win.cc
@@ -185,9 +185,9 @@ int TP_connection_win::start_io()
int TP_connection_win::cancel_io()
{
- if (!CancelIoEx(sock.m_handle, &sock.m_overlapped))
- return GetLastError() == ERROR_NOT_FOUND ? 0 : -1;
- return 1;
+ if (CancelIoEx(sock.m_handle, &sock.m_overlapped))
+ return 0;
+ return GetLastError() == ERROR_NOT_FOUND ? 1 : -1;
}
/*