diff options
Diffstat (limited to 'sql/event_scheduler.cc')
-rw-r--r-- | sql/event_scheduler.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index 423f7e6ea2b..799a689e1c6 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -650,7 +650,8 @@ Event_scheduler::stop() state= STOPPING; DBUG_PRINT("info", ("Scheduler thread has id %lu", (ulong) scheduler_thd->thread_id)); - /* Lock from delete */ + /* Lock from concurrent usage and delete/kill */ + mysql_mutex_lock(&scheduler_thd->LOCK_thd_kill); mysql_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, " @@ -658,6 +659,7 @@ Event_scheduler::stop() (ulong) scheduler_thd->thread_id); scheduler_thd->awake(KILL_CONNECTION); mysql_mutex_unlock(&scheduler_thd->LOCK_thd_data); + mysql_mutex_unlock(&scheduler_thd->LOCK_thd_kill); /* thd could be 0x0, when shutting down */ sql_print_information("Event Scheduler: " |