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.cc30
1 files changed, 14 insertions, 16 deletions
diff --git a/sql/event_queue.cc b/sql/event_queue.cc
index 40fddff094c..0324e05fb27 100644
--- a/sql/event_queue.cc
+++ b/sql/event_queue.cc
@@ -10,8 +10,8 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
+ along with this program; if not, write to the Free Software Foundation,
+ 51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
#include "sql_priv.h"
#include "unireg.h"
@@ -559,9 +559,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 +605,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 +626,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 +757,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 +777,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 +786,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;
}