Commit 67cfb8a5 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-82 : Fix place in thr_lock.c where wait-end callback was called without...

MDEV-82 : Fix place in thr_lock.c where wait-end callback was called without corresponding wait-begin
parent b2bbd30d
...@@ -482,6 +482,7 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, ...@@ -482,6 +482,7 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data,
struct timespec wait_timeout; struct timespec wait_timeout;
enum enum_thr_lock_result result= THR_LOCK_ABORTED; enum enum_thr_lock_result result= THR_LOCK_ABORTED;
const char *old_proc_info; const char *old_proc_info;
my_bool use_wait_callbacks;
DBUG_ENTER("wait_for_lock"); DBUG_ENTER("wait_for_lock");
/* /*
...@@ -534,7 +535,12 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, ...@@ -534,7 +535,12 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data,
and once after the thread has exited the wait loop. and once after the thread has exited the wait loop.
*/ */
if ((!thread_var->abort || in_wait_list) && before_lock_wait) if ((!thread_var->abort || in_wait_list) && before_lock_wait)
{
use_wait_callbacks= TRUE;
(*before_lock_wait)(); (*before_lock_wait)();
}
else
use_wait_callbacks= FALSE;
set_timespec(wait_timeout, lock_wait_timeout); set_timespec(wait_timeout, lock_wait_timeout);
while (!thread_var->abort || in_wait_list) while (!thread_var->abort || in_wait_list)
...@@ -572,7 +578,7 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, ...@@ -572,7 +578,7 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data,
We call the after_lock_wait callback once the wait loop has We call the after_lock_wait callback once the wait loop has
finished. finished.
*/ */
if (after_lock_wait) if (after_lock_wait && use_wait_callbacks)
(*after_lock_wait)(); (*after_lock_wait)();
DBUG_PRINT("thr_lock", ("aborted: %d in_wait_list: %d", DBUG_PRINT("thr_lock", ("aborted: %d in_wait_list: %d",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment