|
|
@ -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); |
|
|
|