summaryrefslogtreecommitdiff
path: root/sql/scheduler.cc
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-07-02 22:08:51 +0200
committerSergei Golubchik <sergii@pisem.net>2011-07-02 22:08:51 +0200
commit9809f05199aeb0b67991fac41bd86f38730768dc (patch)
treefa2792ff86d0da014b535d743759810612338042 /sql/scheduler.cc
parent0accbd0364e0333e0b119aa9ce93e34ded9df6cb (diff)
parent5a0e7394a5ae0c7b6a1ea35b7ea3a8985325987a (diff)
downloadmariadb-git-9809f05199aeb0b67991fac41bd86f38730768dc.tar.gz
5.5-merge
Diffstat (limited to 'sql/scheduler.cc')
-rw-r--r--sql/scheduler.cc31
1 files changed, 22 insertions, 9 deletions
diff --git a/sql/scheduler.cc b/sql/scheduler.cc
index a9146682da6..b1083083c38 100644
--- a/sql/scheduler.cc
+++ b/sql/scheduler.cc
@@ -46,18 +46,32 @@ static bool no_threads_end(THD *thd, bool put_in_cache)
*/
/**@{*/
-static void scheduler_wait_begin(void) {
+extern "C"
+{
+static void scheduler_wait_lock_begin(void) {
+ THD *thd=current_thd;
+ scheduler_functions *func= thd->scheduler;
+ MYSQL_CALLBACK(func, thd_wait_begin, (thd, THD_WAIT_ROW_TABLE_LOCK));
+}
+
+static void scheduler_wait_lock_end(void) {
THD *thd=current_thd;
scheduler_functions *func= thd->scheduler;
- MYSQL_CALLBACK(func,
- thd_wait_begin, (thd, THD_WAIT_ROW_TABLE_LOCK));
+ MYSQL_CALLBACK(func, thd_wait_end, (thd));
+}
+
+static void scheduler_wait_sync_begin(void) {
+ THD *thd=current_thd;
+ scheduler_functions *func= thd->scheduler;
+ MYSQL_CALLBACK(func, thd_wait_begin, (thd, THD_WAIT_TABLE_LOCK));
}
-static void scheduler_wait_end(void) {
+static void scheduler_wait_sync_end(void) {
THD *thd=current_thd;
scheduler_functions *func= thd->scheduler;
MYSQL_CALLBACK(func, thd_wait_end, (thd));
}
+};
/**@}*/
/**
@@ -68,7 +82,10 @@ static void scheduler_wait_end(void) {
mysqld.cc, so this init function will always be called.
*/
static void scheduler_init() {
- thr_set_lock_wait_callback(scheduler_wait_begin, scheduler_wait_end);
+ thr_set_lock_wait_callback(scheduler_wait_lock_begin,
+ scheduler_wait_lock_end);
+ thr_set_sync_wait_callback(scheduler_wait_sync_begin,
+ scheduler_wait_sync_end);
}
/*
@@ -119,10 +136,6 @@ void one_thread_scheduler(scheduler_functions *func)
thd_scheduler::thd_scheduler()
: m_psi(NULL), logged_in(FALSE), io_event(NULL), thread_attached(FALSE)
{
-#ifndef DBUG_OFF
- dbug_explain[0]= '\0';
- set_explain= FALSE;
-#endif
}