diff options
author | Sergei Golubchik <sergii@pisem.net> | 2013-04-15 15:09:22 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2013-04-15 15:09:22 +0200 |
commit | a9035be5b7a7b3865ddb4ef34a5d0cfc65dfc254 (patch) | |
tree | a9df7341e91623f62fe37cd47fce139d8888fc95 /sql/event_scheduler.cc | |
parent | 3a1c91d87d69ef243b3e78be6089102cafef0a8e (diff) | |
parent | f57ecb7786177e0af3b1e3ec94302720b2e0f967 (diff) | |
download | mariadb-git-a9035be5b7a7b3865ddb4ef34a5d0cfc65dfc254.tar.gz |
10.0-base merge
Diffstat (limited to 'sql/event_scheduler.cc')
-rw-r--r-- | sql/event_scheduler.cc | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index ec96ca45a0e..6317af1eac3 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -132,11 +132,11 @@ post_init_event_thread(THD *thd) return TRUE; } + thread_safe_increment32(&thread_count, &thread_count_lock); mysql_mutex_lock(&LOCK_thread_count); threads.append(thd); - thread_count++; - inc_thread_running(); mysql_mutex_unlock(&LOCK_thread_count); + inc_thread_running(); return FALSE; } @@ -154,12 +154,8 @@ deinit_event_thread(THD *thd) { thd->proc_info= "Clearing"; DBUG_PRINT("exit", ("Event thread finishing")); - mysql_mutex_lock(&LOCK_thread_count); - thread_count--; - dec_thread_running(); - delete thd; - mysql_cond_broadcast(&COND_thread_count); - mysql_mutex_unlock(&LOCK_thread_count); + + delete_running_thd(thd); } @@ -440,12 +436,7 @@ Event_scheduler::start() ret= TRUE; new_thd->proc_info= "Clearing"; - mysql_mutex_lock(&LOCK_thread_count); - thread_count--; - dec_thread_running(); - delete new_thd; - mysql_cond_broadcast(&COND_thread_count); - mysql_mutex_unlock(&LOCK_thread_count); + delete_running_thd(new_thd); } end: UNLOCK_DATA(); @@ -574,12 +565,7 @@ error: if (new_thd) { new_thd->proc_info= "Clearing"; - mysql_mutex_lock(&LOCK_thread_count); - thread_count--; - dec_thread_running(); - delete new_thd; - mysql_cond_broadcast(&COND_thread_count); - mysql_mutex_unlock(&LOCK_thread_count); + delete_running_thd(new_thd); } delete event_name; DBUG_RETURN(TRUE); |