From ab3388c3c44caecbec9974f54a2f30dd06237eee Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 12 Dec 2016 01:00:45 +0100 Subject: [PATCH] bugfix: mutex order violation in embedded safe_mutex: Found wrong usage of mutex 'LOCK_thread_count' and 'LOCK_status' Mutex currently locked (in reverse order): LOCK_status sql/sql_class.h line 3873 LOCK_thread_count libmysqld/lib_sql.cc line 432 --- libmysqld/lib_sql.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 63424af27f684..0dfb1a1ad9a9f 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -434,8 +434,8 @@ static void emb_free_embedded_thd(MYSQL *mysql) thread_count--; thd->store_globals(); thd->unlink(); - delete thd; mysql_mutex_unlock(&LOCK_thread_count); + delete thd; my_pthread_setspecific_ptr(THR_THD, 0); mysql->thd=0; }