mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Fixed bug in wait_for_update() that I had introduced.
Changed option variables to my_bool (to avoid bugs in my_getopt()) Added new thread specific mutex LOCK_delete to be able to free LOCK_thread_count early. Changed usage of LOCK_thread_count -> LOCK_status for statistics variables libmysqld/lib_sql.cc: Removed not needed LOCK mysql-test/mysql-test-run.sh: Log name of running test mysql-test/r/rpl_sporadic_master.result: Cleaned up test mysql-test/t/rpl_sporadic_master.test: cleaned up test sql/log.cc: Cleanup. Fixed bug in wait_for_update() that I had introduced. sql/mini_client.cc: Indentation changes. sql/mysql_priv.h: Changed option variables to my_bool. sql/mysqld.cc: Changed option variables to my_bool. Removed not used LOCK_server_id Minor code cleanups. sql/repl_failsafe.cc: Minor code cleanups sql/slave.cc: Minor code cleanups. Fixed usage of wait_for_update(). sql/slave.h: Changed option variables to my_bool. sql/sql_class.cc: Added new thread specific mutex LOCK_delete to be able to free LOCK_thread_count early sql/sql_class.h: Added new thread specific mutex LOCK_delete to be able to free LOCK_thread_count early sql/sql_insert.cc: Do broadcast after unlock() sql/sql_parse.cc: Removed not needed LOCK Changed usage of LOCK_thread_count -> LOCK_status for statistics variables Changed killing of threads to not lock LOCK_thread_count for long. sql/sql_repl.cc: Changed options variables to my_bool Fixed usage of wait_for_update() Fixed loop to kill slaves to not lock LOCK_thread_count for long. Code optimization. sql/sql_repl.h: bool -> my_bool Fixed KICK_SLAVE to use LOCK_delete
This commit is contained in:
@@ -116,8 +116,8 @@ THD::THD():user_time(0),fatal_error(0),last_insert_id_used(0),
|
||||
#endif
|
||||
#ifdef SIGNAL_WITH_VIO_CLOSE
|
||||
active_vio = 0;
|
||||
pthread_mutex_init(&active_vio_lock, MY_MUTEX_INIT_FAST);
|
||||
#endif
|
||||
pthread_mutex_init(&LOCK_delete, MY_MUTEX_INIT_FAST);
|
||||
|
||||
/* Variables with default values */
|
||||
proc_info="login";
|
||||
@@ -189,6 +189,10 @@ THD::~THD()
|
||||
{
|
||||
THD_CHECK_SENTRY(this);
|
||||
DBUG_ENTER("~THD()");
|
||||
/* Ensure that no one is using THD */
|
||||
pthread_mutex_lock(&LOCK_delete);
|
||||
pthread_mutex_unlock(&LOCK_delete);
|
||||
|
||||
/* Close connection */
|
||||
if (net.vio)
|
||||
{
|
||||
@@ -217,18 +221,19 @@ THD::~THD()
|
||||
free_root(&mem_root,MYF(0));
|
||||
free_root(&transaction.mem_root,MYF(0));
|
||||
mysys_var=0; // Safety (shouldn't be needed)
|
||||
#ifdef SIGNAL_WITH_VIO_CLOSE
|
||||
pthread_mutex_destroy(&active_vio_lock);
|
||||
#endif
|
||||
pthread_mutex_destroy(&LOCK_delete);
|
||||
#ifndef DBUG_OFF
|
||||
dbug_sentry = THD_SENTRY_GONE;
|
||||
#endif
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
||||
void THD::awake(bool prepare_to_die)
|
||||
{
|
||||
THD_CHECK_SENTRY(this);
|
||||
safe_mutex_assert_owner(&LOCK_delete);
|
||||
|
||||
if (prepare_to_die)
|
||||
killed = 1;
|
||||
thr_alarm_kill(real_id);
|
||||
|
||||
Reference in New Issue
Block a user