diff options
author | Mikael Ronstrom <mikael@dator8> | 2011-03-04 13:12:31 +0100 |
---|---|---|
committer | Mikael Ronstrom <mikael@dator8> | 2011-03-04 13:12:31 +0100 |
commit | b14adc3921d3f2e30f858a31ae73ecdc65901e54 (patch) | |
tree | a7f5ebaca17d2031a07efaa3418357b9b756de46 /sql | |
parent | 5f24be65270c844ba705de9121a95b3bb048dcc3 (diff) | |
download | mariadb-git-b14adc3921d3f2e30f858a31ae73ecdc65901e54.tar.gz |
More review fixes
Diffstat (limited to 'sql')
-rw-r--r-- | sql/item_func.cc | 8 | ||||
-rw-r--r-- | sql/mdl.cc | 4 | ||||
-rw-r--r-- | sql/scheduler.cc | 3 |
3 files changed, 9 insertions, 6 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc index 9195cf4f8c7..a149bb7f955 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3877,12 +3877,11 @@ longlong Item_func_get_lock::val_int() timed_cond.set_timeout(timeout * ULL(1000000000)); error= 0; + thd_wait_begin(thd, THD_WAIT_USER_LOCK); while (ull->locked && !thd->killed) { DBUG_PRINT("info", ("waiting on lock")); - thd_wait_begin(thd, THD_WAIT_USER_LOCK); error= timed_cond.wait(&ull->cond, &LOCK_user_locks); - thd_wait_end(thd); if (error == ETIMEDOUT || error == ETIME) { DBUG_PRINT("info", ("lock wait timeout")); @@ -3890,6 +3889,7 @@ longlong Item_func_get_lock::val_int() } error= 0; } + thd_wait_end(thd); if (ull->locked) { @@ -4107,15 +4107,15 @@ longlong Item_func_sleep::val_int() thd->mysys_var->current_cond= &cond; error= 0; + thd_wait_begin(thd, THD_WAIT_SLEEP); while (!thd->killed) { - thd_wait_begin(thd, THD_WAIT_SLEEP); error= timed_cond.wait(&cond, &LOCK_user_locks); - thd_wait_end(thd); if (error == ETIMEDOUT || error == ETIME) break; error= 0; } + thd_wait_end(thd); thd_proc_info(thd, 0); mysql_mutex_unlock(&LOCK_user_locks); mysql_mutex_lock(&thd->mysys_var->mutex); diff --git a/sql/mdl.cc b/sql/mdl.cc index 6cab1238b43..21410db2d22 100644 --- a/sql/mdl.cc +++ b/sql/mdl.cc @@ -975,14 +975,14 @@ MDL_wait::timed_wait(THD *thd, struct timespec *abs_timeout, old_msg= thd_enter_cond(thd, &m_COND_wait_status, &m_LOCK_wait_status, wait_state_name); + thd_wait_begin(thd, THD_WAIT_META_DATA_LOCK); while (!m_wait_status && !thd_killed(thd) && wait_result != ETIMEDOUT && wait_result != ETIME) { - thd_wait_begin(thd, THD_WAIT_META_DATA_LOCK); wait_result= mysql_cond_timedwait(&m_COND_wait_status, &m_LOCK_wait_status, abs_timeout); - thd_wait_end(thd); } + thd_wait_end(thd); if (m_wait_status == EMPTY) { diff --git a/sql/scheduler.cc b/sql/scheduler.cc index 328ad45b4b8..a3848e20be5 100644 --- a/sql/scheduler.cc +++ b/sql/scheduler.cc @@ -80,6 +80,8 @@ scheduler_functions *thread_scheduler= NULL; */ /**@{*/ +extern "C" +{ static void scheduler_wait_lock_begin(void) { MYSQL_CALLBACK(thread_scheduler, thd_wait_begin, (current_thd, THD_WAIT_TABLE_LOCK)); @@ -97,6 +99,7 @@ static void scheduler_wait_sync_begin(void) { static void scheduler_wait_sync_end(void) { MYSQL_CALLBACK(thread_scheduler, thd_wait_end, (current_thd)); } +}; /**@}*/ /** |