summaryrefslogtreecommitdiff
path: root/mysys/thr_lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'mysys/thr_lock.c')
-rw-r--r--mysys/thr_lock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mysys/thr_lock.c b/mysys/thr_lock.c
index 484fd1dd559..d6877c8c998 100644
--- a/mysys/thr_lock.c
+++ b/mysys/thr_lock.c
@@ -427,6 +427,8 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data,
wait->last= &data->next;
}
+ statistic_increment(locks_waited, &THR_LOCK_lock);
+
/* Set up control struct to allow others to abort locks */
thread_var->current_mutex= &data->lock->mutex;
thread_var->current_cond= cond;
@@ -491,7 +493,6 @@ wait_for_lock(struct st_lock_list *wait, THR_LOCK_DATA *data,
else
{
result= THR_LOCK_SUCCESS;
- statistic_increment(locks_waited, &THR_LOCK_lock);
if (data->lock->get_status)
(*data->lock->get_status)(data->status_param, 0);
check_locks(data->lock,"got wait_for_lock",0);