summaryrefslogtreecommitdiff
path: root/mysys/thr_mutex.c
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2020-03-30 20:12:02 +0300
committerMonty <monty@mariadb.org>2020-04-19 17:33:51 +0300
commitf9f33b85be6b5006f0ecd0de7961c71d415a9d73 (patch)
treeae547acc02c05876ccc9f54a3c7be614af206425 /mysys/thr_mutex.c
parent7866b723048d1d0f4a202d5a1e5475420b1dda64 (diff)
downloadmariadb-git-f9f33b85be6b5006f0ecd0de7961c71d415a9d73.tar.gz
Handle errors from external_unlock & mysql_unlock_tables
Other things: - Handler errors from ha_maria::implict_commit - Disable DBUG in safe_mutex_lock to get trace file easier to read
Diffstat (limited to 'mysys/thr_mutex.c')
-rw-r--r--mysys/thr_mutex.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index 4f495048f63..9db1e0efabf 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -233,6 +233,7 @@ int safe_mutex_lock(safe_mutex_t *mp, myf my_flags, const char *file,
int error;
DBUG_PRINT("mutex", ("%s (0x%lx) locking", mp->name ? mp->name : "Null",
(ulong) mp));
+ DBUG_PUSH("");
pthread_mutex_lock(&mp->global);
if (!mp->file)
@@ -283,7 +284,7 @@ int safe_mutex_lock(safe_mutex_t *mp, myf my_flags, const char *file,
{
error= pthread_mutex_trylock(&mp->mutex);
if (error == EBUSY)
- return error;
+ goto end;
}
else
error= pthread_mutex_lock(&mp->mutex);
@@ -393,7 +394,10 @@ int safe_mutex_lock(safe_mutex_t *mp, myf my_flags, const char *file,
}
}
- DBUG_PRINT("mutex", ("%s (0x%lx) locked", mp->name, (ulong) mp));
+end:
+ DBUG_POP();
+ if (!error)
+ DBUG_PRINT("mutex", ("%s (0x%lx) locked", mp->name, (ulong) mp));
return error;
}