summaryrefslogtreecommitdiff
path: root/sql/sql_test.cc
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2014-03-20 11:11:13 +0400
committerSergey Vojtovich <svoj@mariadb.org>2014-03-20 11:11:13 +0400
commite4fde57712afd106ccf9752ceadcdcac604da8d9 (patch)
tree38fa87f38f8af27d47f51bb9ebee3623b5b8bfcc /sql/sql_test.cc
parent8250824a12fc173f14af8bb6a2cdbc29a94a84f0 (diff)
downloadmariadb-git-e4fde57712afd106ccf9752ceadcdcac604da8d9.tar.gz
MDEV-5864 - Reduce usage of LOCK_open: TABLE_SHARE::tdc.free_tables
Let TABLE_SHARE::tdc.free_tables, TABLE_SHARE::tdc.all_tables, TABLE_SHARE::tdc.flushed and corresponding invariants be protected by per-share TABLE_SHARE::tdc.LOCK_table_share instead of global LOCK_open.
Diffstat (limited to 'sql/sql_test.cc')
-rw-r--r--sql/sql_test.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_test.cc b/sql/sql_test.cc
index 8588d6564ca..542a3421fcf 100644
--- a/sql/sql_test.cc
+++ b/sql/sql_test.cc
@@ -88,9 +88,9 @@ static void print_cached_tables(void)
puts("DB Table Version Thread Open Lock");
tdc_it.init();
- mysql_mutex_lock(&LOCK_open);
while ((share= tdc_it.next()))
{
+ mysql_mutex_lock(&share->tdc.LOCK_table_share);
TABLE_SHARE::All_share_tables_list::Iterator it(share->tdc.all_tables);
while ((entry= it++))
{
@@ -102,8 +102,8 @@ static void print_cached_tables(void)
in_use ? lock_descriptions[(int)entry->reginfo.lock_type] :
"Not in use");
}
+ mysql_mutex_unlock(&share->tdc.LOCK_table_share);
}
- mysql_mutex_unlock(&LOCK_open);
tdc_it.deinit();
printf("\nCurrent refresh version: %ld\n", tdc_refresh_version());
fflush(stdout);