summaryrefslogtreecommitdiff
path: root/sql/event_queue.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/event_queue.cc')
-rw-r--r--sql/event_queue.cc29
1 files changed, 14 insertions, 15 deletions
diff --git a/sql/event_queue.cc b/sql/event_queue.cc
index 1a81d981906..6ee093ec7f4 100644
--- a/sql/event_queue.cc
+++ b/sql/event_queue.cc
@@ -13,6 +13,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */
+#include <my_global.h>
#include "sql_priv.h"
#include "unireg.h"
#include "event_queue.h"
@@ -190,7 +191,7 @@ Event_queue::deinit_queue()
@param[out] created set to TRUE if no error and the element is
added to the queue, FALSE otherwise
- @retval TRUE an error occured. The value of created is undefined,
+ @retval TRUE an error occurred. The value of created is undefined,
the element was not deleted.
@retval FALSE success
*/
@@ -559,9 +560,6 @@ Event_queue::dbug_dump_queue(my_time_t when)
#endif
}
-static const char *queue_empty_msg= "Waiting on empty queue";
-static const char *queue_wait_msg= "Waiting for next activation";
-
/*
Checks whether the top of the queue is elligible for execution and
returns an Event_job_data instance in case it should be executed.
@@ -608,7 +606,7 @@ Event_queue::get_top_for_execution_if_time(THD *thd,
mysql_audit_release(thd);
/* Wait on condition until signaled. Release LOCK_queue while waiting. */
- cond_wait(thd, NULL, queue_empty_msg, SCHED_FUNC, __LINE__);
+ cond_wait(thd, NULL, & stage_waiting_on_empty_queue, SCHED_FUNC, __FILE__, __LINE__);
continue;
}
@@ -629,7 +627,8 @@ Event_queue::get_top_for_execution_if_time(THD *thd,
/* Release any held audit resources before waiting */
mysql_audit_release(thd);
- cond_wait(thd, &top_time, queue_wait_msg, SCHED_FUNC, __LINE__);
+ cond_wait(thd, &top_time, &stage_waiting_for_next_activation, SCHED_FUNC, __FILE__, __LINE__);
+
continue;
}
@@ -759,16 +758,16 @@ Event_queue::unlock_data(const char *func, uint line)
*/
void
-Event_queue::cond_wait(THD *thd, struct timespec *abstime, const char* msg,
- const char *func, uint line)
+Event_queue::cond_wait(THD *thd, struct timespec *abstime, const PSI_stage_info *stage,
+ const char *src_func, const char *src_file, uint src_line)
{
DBUG_ENTER("Event_queue::cond_wait");
waiting_on_cond= TRUE;
- mutex_last_unlocked_at_line= line;
+ mutex_last_unlocked_at_line= src_line;
mutex_queue_data_locked= FALSE;
- mutex_last_unlocked_in_func= func;
+ mutex_last_unlocked_in_func= src_func;
- thd->enter_cond(&COND_queue_state, &LOCK_event_queue, msg);
+ thd->enter_cond(&COND_queue_state, &LOCK_event_queue, stage, NULL, src_func, src_file, src_line);
if (!thd->killed)
{
@@ -779,8 +778,8 @@ Event_queue::cond_wait(THD *thd, struct timespec *abstime, const char* msg,
mysql_cond_timedwait(&COND_queue_state, &LOCK_event_queue, abstime);
}
- mutex_last_locked_in_func= func;
- mutex_last_locked_at_line= line;
+ mutex_last_locked_in_func= src_func;
+ mutex_last_locked_at_line= src_line;
mutex_queue_data_locked= TRUE;
waiting_on_cond= FALSE;
@@ -788,8 +787,8 @@ Event_queue::cond_wait(THD *thd, struct timespec *abstime, const char* msg,
This will free the lock so we need to relock. Not the best thing to
do but we need to obey cond_wait()
*/
- thd->exit_cond("");
- lock_data(func, line);
+ thd->exit_cond(NULL, src_func, src_file, src_line);
+ lock_data(src_func, src_line);
DBUG_VOID_RETURN;
}