summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorSergey Petrunya <psergey@askmonty.org>2012-06-07 12:19:06 +0400
committerSergey Petrunya <psergey@askmonty.org>2012-06-07 12:19:06 +0400
commit2c1e737c6c955ef6e670514d3bd9031727f3602c (patch)
tree0d97958460420a3b2633eb9fb6a2d57b2405e9fb /sql/sql_class.cc
parent9a7b3bf4b7b08f9fd1d26260131696475998ab81 (diff)
downloadmariadb-git-2c1e737c6c955ef6e670514d3bd9031727f3602c.tar.gz
MDEV-297: SHOW EXPLAIN: Server gets stuck until timeout occurs while executing SHOW
INDEX and SHOW EXPLAIN in parallel - Rework locking code to use the LOCK_thd_data mutex for all synchronization. This also fixed MDEV-301.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 2ad4e77405d..f477c0fe0ec 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1196,7 +1196,7 @@ void THD::init(void)
/* Initialize the Debug Sync Facility. See debug_sync.cc. */
debug_sync_init_thread(this);
#endif /* defined(ENABLED_DEBUG_SYNC) */
- apc_target.init();
+ apc_target.init(&LOCK_thd_data);
}
@@ -1372,6 +1372,8 @@ THD::~THD()
{
THD_CHECK_SENTRY(this);
DBUG_ENTER("~THD()");
+ //psergey-todo: assert that the queue is disabled and empty.
+
/* Ensure that no one is using THD */
mysql_mutex_lock(&LOCK_thd_data);
mysys_var=0; // Safety (shouldn't be needed)