From e4fde57712afd106ccf9752ceadcdcac604da8d9 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Thu, 20 Mar 2014 11:11:13 +0400 Subject: 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. --- sql/sql_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/sql_test.cc') 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); -- cgit v1.2.1