summaryrefslogtreecommitdiff
path: root/sql/event_scheduler.cc
diff options
context:
space:
mode:
authorMartin Hansson <martin.hansson@sun.com>2009-11-20 13:29:43 +0100
committerMartin Hansson <martin.hansson@sun.com>2009-11-20 13:29:43 +0100
commitca595821498d6a547fa1780df86cdf127b0019b3 (patch)
treefabb9c5fa11cdf96ecdc1297561875b1a58090ed /sql/event_scheduler.cc
parentb4a3083dc8b8049e64692ffc8e6e527914fb93da (diff)
parent4205c622e1a741bae1b2d8d213342f8e0bdd936a (diff)
downloadmariadb-git-ca595821498d6a547fa1780df86cdf127b0019b3.tar.gz
merge of Bug#33204 (backport)
Diffstat (limited to 'sql/event_scheduler.cc')
-rw-r--r--sql/event_scheduler.cc6
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 {