summaryrefslogtreecommitdiff
path: root/sql/event_scheduler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/event_scheduler.cc')
-rw-r--r--sql/event_scheduler.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/sql/event_scheduler.cc b/sql/event_scheduler.cc
index aa4d376d86e..bf16ddcb05a 100644
--- a/sql/event_scheduler.cc
+++ b/sql/event_scheduler.cc
@@ -349,6 +349,14 @@ Event_scheduler::Event_scheduler(Event_queue *queue_arg)
mysql_mutex_init(key_event_scheduler_LOCK_scheduler_state,
&LOCK_scheduler_state, MY_MUTEX_INIT_FAST);
mysql_cond_init(key_event_scheduler_COND_state, &COND_state, NULL);
+
+#ifdef SAFE_MUTEX
+ /* Ensure right mutex order */
+ mysql_mutex_lock(&LOCK_scheduler_state);
+ mysql_mutex_lock(&LOCK_global_system_variables);
+ mysql_mutex_unlock(&LOCK_global_system_variables);
+ mysql_mutex_unlock(&LOCK_scheduler_state);
+#endif
}