Commit 998d7d15 authored by Jimmy Yang's avatar Jimmy Yang

Fix Bug #12882177 - INSTRUMENTATION IN PFS_MUTEX_ENTER_NOWAIT_FUNC IS INCORRECT

Use PSI_MUTEX_TRYLOCK instead of PSI_MUTEX_LOCK when acquire mutex with
"no_wait" option
      
Approved by Sunny Bains
parent 10637a25
...@@ -272,11 +272,10 @@ pfs_mutex_enter_nowait_func( ...@@ -272,11 +272,10 @@ pfs_mutex_enter_nowait_func(
ulint ret; ulint ret;
struct PSI_mutex_locker* locker = NULL; struct PSI_mutex_locker* locker = NULL;
PSI_mutex_locker_state state; PSI_mutex_locker_state state;
int result = 0;
if (UNIV_LIKELY(PSI_server && mutex->pfs_psi)) { if (UNIV_LIKELY(PSI_server && mutex->pfs_psi)) {
locker = PSI_server->get_thread_mutex_locker( locker = PSI_server->get_thread_mutex_locker(
&state, mutex->pfs_psi, PSI_MUTEX_LOCK); &state, mutex->pfs_psi, PSI_MUTEX_TRYLOCK);
if (locker) { if (locker) {
PSI_server->start_mutex_wait(locker, file_name, line); PSI_server->start_mutex_wait(locker, file_name, line);
} }
...@@ -285,7 +284,7 @@ pfs_mutex_enter_nowait_func( ...@@ -285,7 +284,7 @@ pfs_mutex_enter_nowait_func(
ret = mutex_enter_nowait_func(mutex, file_name, line); ret = mutex_enter_nowait_func(mutex, file_name, line);
if (locker) { if (locker) {
PSI_server->end_mutex_wait(locker, result); PSI_server->end_mutex_wait(locker, ret);
} }
return(ret); return(ret);
......
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