diff options
Diffstat (limited to 'sql/event_scheduler.cc')
-rw-r--r-- | sql/event_scheduler.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc index daaa6be0520..d9ca161f260 100644 --- a/sql/event_scheduler.cc +++ b/sql/event_scheduler.cc @@ -128,7 +128,6 @@ post_init_event_thread(THD *thd) thd->cleanup(); return TRUE; } - lex_start(thd); pthread_mutex_lock(&LOCK_thread_count); threads.append(thd); @@ -607,7 +606,12 @@ Event_scheduler::stop() LOCK_DATA(); DBUG_PRINT("info", ("state before action %s", scheduler_states_names[state].str)); if (state != RUNNING) + { + /* Synchronously wait until the scheduler stops. */ + while (state != INITIALIZED) + COND_STATE_WAIT(thd, NULL, "Waiting for the scheduler to stop"); goto end; + } /* Guarantee we don't catch spurious signals */ do { |