diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2019-01-24 18:56:59 +0100 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2019-01-28 17:45:35 +0400 |
commit | 8b4fcc434d5e5afdac3068c9ef041e75f4255e79 (patch) | |
tree | 75394e6300740e5fdc8ed590e33dbd322480a6e1 /sql/mysqld.h | |
parent | 9824ec81aaade5173e59574e2b76bbead9ef9591 (diff) | |
download | mariadb-git-8b4fcc434d5e5afdac3068c9ef041e75f4255e79.tar.gz |
Use rwlock rather than mutex for protecting THD_list
modifications (insert/erase) are protected by write lock
iteration over list is protected by read lock.
This way, threads that iterate over the list (as in SHOW PROCESSLIST,
SHOW GLOBAL STATUS) do not block each other.
Diffstat (limited to 'sql/mysqld.h')
-rw-r--r-- | sql/mysqld.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/mysqld.h b/sql/mysqld.h index a969dc5968e..33eee98afeb 100644 --- a/sql/mysqld.h +++ b/sql/mysqld.h @@ -344,7 +344,7 @@ extern PSI_mutex_key key_BINLOG_LOCK_index, key_BINLOG_LOCK_xid_list, key_rpl_group_info_sleep_lock, key_structure_guard_mutex, key_TABLE_SHARE_LOCK_ha_data, key_LOCK_start_thread, - key_LOCK_error_messages, key_LOCK_thread_count, key_Thread_map_mutex, + key_LOCK_error_messages, key_PARTITION_LOCK_auto_inc; extern PSI_mutex_key key_RELAYLOG_LOCK_index; extern PSI_mutex_key key_LOCK_relaylog_end_pos; @@ -361,7 +361,8 @@ extern PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger, key_rwlock_LOCK_sys_init_connect, key_rwlock_LOCK_sys_init_slave, key_rwlock_LOCK_system_variables_hash, key_rwlock_query_cache_query_lock, key_LOCK_SEQUENCE, - key_rwlock_LOCK_vers_stats, key_rwlock_LOCK_stat_serial; + key_rwlock_LOCK_vers_stats, key_rwlock_LOCK_stat_serial, + key_rwlock_THD_list; #ifdef HAVE_MMAP extern PSI_cond_key key_PAGE_cond, key_COND_active, key_COND_pool; |