diff options
Diffstat (limited to 'mysys/thr_lock.c')
-rw-r--r-- | mysys/thr_lock.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c index 8b30c93b2ec..926951b7443 100644 --- a/mysys/thr_lock.c +++ b/mysys/thr_lock.c @@ -483,6 +483,7 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, struct timespec wait_timeout; enum enum_thr_lock_result result= THR_LOCK_ABORTED; const char *old_proc_info; + my_bool use_wait_callbacks; DBUG_ENTER("wait_for_lock"); /* @@ -535,7 +536,12 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data, and once after the thread has exited the wait loop. */ if ((!thread_var->abort || in_wait_list) && before_lock_wait) + { + use_wait_callbacks= TRUE; (*before_lock_wait)(); + } + else + use_wait_callbacks= FALSE; set_timespec(wait_timeout, lock_wait_timeout); while (!thread_var->abort || in_wait_list) @@ -573,7 +579,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 finished. */ - if (after_lock_wait) + if (after_lock_wait && use_wait_callbacks) (*after_lock_wait)(); DBUG_PRINT("thr_lock", ("aborted: %d in_wait_list: %d", |