summaryrefslogtreecommitdiff
path: root/mysys/thr_mutex.c
diff options
context:
space:
mode:
Diffstat (limited to 'mysys/thr_mutex.c')
-rw-r--r--mysys/thr_mutex.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c
index c46b68761db..b5abf987461 100644
--- a/mysys/thr_mutex.c
+++ b/mysys/thr_mutex.c
@@ -160,6 +160,9 @@ static int safe_mutex_lazy_init_deadlock_detection(safe_mutex_t *mp)
&mp->locked_mutex, sizeof(*mp->locked_mutex),
&mp->used_mutex, sizeof(*mp->used_mutex), NullS))
{
+ /* Disable deadlock handling for this mutex */
+ mp->create_flags|= MYF_NO_DEADLOCK_DETECTION;
+ mp->active_flags|= MYF_NO_DEADLOCK_DETECTION;
return 1; /* Error */
}
@@ -196,6 +199,9 @@ int safe_mutex_init(safe_mutex_t *mp,
mp->line= line;
/* Skip the very common '&' prefix from the autogenerated name */
mp->name= name[0] == '&' ? name + 1 : name;
+
+ if (!safe_mutex_deadlock_detector)
+ my_flags|= MYF_NO_DEADLOCK_DETECTION;
/* Deadlock detection is initialised only lazily, on first use. */
mp->create_flags= my_flags;