1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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.
This commit is contained in:
Sergey Petrunya
2012-06-07 12:19:06 +04:00
parent 9a7b3bf4b7
commit 2c1e737c6c
6 changed files with 119 additions and 78 deletions

View File

@ -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)