mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
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.
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user