From 8553525931fa34fb89f3bb12ffd07c99f4d436f5 Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Fri, 25 Jan 2019 14:24:35 +0400 Subject: MDEV-18400 - Move shutdown handling to main thread Signal handler is now respoinsible for setting abort_loop and breaking poll() in main thread. The rest is handled by main thread itself. Removed redundant LOCK_error_log init/destroy wrappers. Removed redundant unireg_end(): it is trivial and it has only one caller. Removed unused ready_to_exit from PFS. Removed kill_in_progress: duplicates abort_loop. Removed shutdown_in_progress: duplicates abort_loop. Removed ready_to_exit: was used to make sure main thread waits for cleanups, which are now done by main thread itself. Removed SIGNALS_DONT_BREAK_READ, MAYBE_BROKEN_SYSCALL, kill_broken_server: never defined/used. Make clean_up() static. --- sql/rpl_mi.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql/rpl_mi.cc') diff --git a/sql/rpl_mi.cc b/sql/rpl_mi.cc index 897d4394525..8d3e146f4c5 100644 --- a/sql/rpl_mi.cc +++ b/sql/rpl_mi.cc @@ -1436,7 +1436,7 @@ bool Master_info_index::add_master_info(Master_info *mi, bool write_to_file) We have to protect against shutdown to ensure we are not calling my_hash_insert() while my_hash_free() is in progress */ - if (unlikely(shutdown_in_progress) || + if (unlikely(abort_loop) || !my_hash_insert(&master_info_hash, (uchar*) mi)) { if (global_system_variables.log_warnings > 1) @@ -1579,7 +1579,7 @@ uint any_slave_sql_running(bool already_locked) if (!already_locked) mysql_mutex_lock(&LOCK_active_mi); - if (unlikely(shutdown_in_progress || !master_info_index)) + if (unlikely(abort_loop || !master_info_index)) count= 1; else { -- cgit v1.2.1