summaryrefslogtreecommitdiff
path: root/sql/scheduler.cc
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@montyprogram.com>2012-02-17 23:33:18 +0100
committerVladislav Vaintroub <wlad@montyprogram.com>2012-02-17 23:33:18 +0100
commit58c3e32dbdd43e8635c0320fcf5cc744e354fc65 (patch)
treef36d1fa78e3336d6143c6a3e7029e9bbf9acd2a7 /sql/scheduler.cc
parent2a5d8ea9a201a1bf33fe309b8293e31ebd961e60 (diff)
downloadmariadb-git-58c3e32dbdd43e8635c0320fcf5cc744e354fc65.tar.gz
Simplify thd_wait_begin. given how seldom they are called, calling current_thd one more time is not going to be anything performance relevant.
Also use thd_wait_begin/end for thr_lock and sync callbacks.
Diffstat (limited to 'sql/scheduler.cc')
-rw-r--r--sql/scheduler.cc18
1 files changed, 5 insertions, 13 deletions
diff --git a/sql/scheduler.cc b/sql/scheduler.cc
index 3f779337345..720b0d812cc 100644
--- a/sql/scheduler.cc
+++ b/sql/scheduler.cc
@@ -46,28 +46,20 @@ static bool no_threads_end(THD *thd, bool put_in_cache)
/**@{*/
extern "C"
{
-static void scheduler_wait_lock_begin(void) {
- THD *thd=current_thd;
- if(thd)
- MYSQL_CALLBACK(thd->scheduler, thd_wait_begin, (thd, THD_WAIT_TABLE_LOCK));
+static void scheduler_wait_lock_begin(void) {
+ thd_wait_begin(NULL, THD_WAIT_TABLE_LOCK);
}
static void scheduler_wait_lock_end(void) {
- THD *thd=current_thd;
- if(thd)
- MYSQL_CALLBACK(thd->scheduler, thd_wait_end, (thd));
+ thd_wait_end(NULL);
}
static void scheduler_wait_sync_begin(void) {
- THD *thd=current_thd;
- if(thd)
- MYSQL_CALLBACK(thd->scheduler, thd_wait_begin, (thd, THD_WAIT_TABLE_LOCK));
+ thd_wait_begin(NULL, THD_WAIT_SYNC);
}
static void scheduler_wait_sync_end(void) {
- THD *thd=current_thd;
- if(thd)
- MYSQL_CALLBACK(thd->scheduler, thd_wait_end, (thd));
+ thd_wait_end(NULL);
}
};
/**@}*/