diff options
Diffstat (limited to 'sql/event_scheduler.cc')
-rw-r--r-- | sql/event_scheduler.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index 7a668e2e2d7..06b7bd3fc6a 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -158,6 +158,7 @@ deinit_event_thread(THD *thd) thread_count--; thread_running--; delete thd; + pthread_cond_broadcast(&COND_thread_count); pthread_mutex_unlock(&LOCK_thread_count); } @@ -426,6 +427,7 @@ Event_scheduler::start() thread_count--; thread_running--; delete new_thd; + pthread_cond_broadcast(&COND_thread_count); pthread_mutex_unlock(&LOCK_thread_count); } end: @@ -558,6 +560,7 @@ error: thread_count--; thread_running--; delete new_thd; + pthread_cond_broadcast(&COND_thread_count); pthread_mutex_unlock(&LOCK_thread_count); } delete event_name; @@ -633,13 +636,13 @@ Event_scheduler::stop() DBUG_PRINT("info", ("Scheduler thread has id %lu", scheduler_thd->thread_id)); /* Lock from delete */ - pthread_mutex_lock(&scheduler_thd->LOCK_delete); + pthread_mutex_lock(&scheduler_thd->LOCK_thd_data); /* This will wake up the thread if it waits on Queue's conditional */ sql_print_information("Event Scheduler: Killing the scheduler thread, " "thread id %lu", scheduler_thd->thread_id); scheduler_thd->awake(THD::KILL_CONNECTION); - pthread_mutex_unlock(&scheduler_thd->LOCK_delete); + pthread_mutex_unlock(&scheduler_thd->LOCK_thd_data); /* thd could be 0x0, when shutting down */ sql_print_information("Event Scheduler: " |