summaryrefslogtreecommitdiff
path: root/sql/mdl.cc
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2019-12-16 18:27:06 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2020-01-12 21:34:59 +0100
commit98a67eccc57774a9322ed006ab3d871181130888 (patch)
tree016502603c62a94be777dd6c18c28943d48a54ce /sql/mdl.cc
parent508bc20a85413c599ba5a6eecbd17046269696ae (diff)
downloadmariadb-git-98a67eccc57774a9322ed006ab3d871181130888.tar.gz
MDEV-21327 : MDL wait notification for innodb background threadpool
Diffstat (limited to 'sql/mdl.cc')
-rw-r--r--sql/mdl.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/mdl.cc b/sql/mdl.cc
index e7c0d699d76..c4d6f89644b 100644
--- a/sql/mdl.cc
+++ b/sql/mdl.cc
@@ -24,6 +24,8 @@
#include <mysql/plugin.h>
#include <mysql/service_thd_wait.h>
#include <mysql/psi/mysql_stage.h>
+#include <tpool.h>
+
#ifdef HAVE_PSI_INTERFACE
static PSI_mutex_key key_MDL_wait_LOCK_wait_status;
@@ -1125,6 +1127,7 @@ MDL_wait::timed_wait(MDL_context_owner *owner, struct timespec *abs_timeout,
owner->ENTER_COND(&m_COND_wait_status, &m_LOCK_wait_status,
wait_state_name, & old_stage);
thd_wait_begin(NULL, THD_WAIT_META_DATA_LOCK);
+ tpool::tpool_wait_begin();
while (!m_wait_status && !owner->is_killed() &&
wait_result != ETIMEDOUT && wait_result != ETIME)
{
@@ -1147,6 +1150,7 @@ MDL_wait::timed_wait(MDL_context_owner *owner, struct timespec *abs_timeout,
wait_result= mysql_cond_timedwait(&m_COND_wait_status, &m_LOCK_wait_status,
abs_timeout);
}
+ tpool::tpool_wait_end();
thd_wait_end(NULL);
if (m_wait_status == EMPTY)