From 2532adf49baa90a801bf55a7bce5fb71df081b2d Mon Sep 17 00:00:00 2001 From: "guilhem@mysql.com" <> Date: Sat, 31 Jul 2004 09:49:32 +0200 Subject: [PATCH] removing assertion (will be moved to 4.1) for non-debug to compile --- sql/sql_class.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sql/sql_class.h b/sql/sql_class.h index e045c70517e..df246b42337 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -535,11 +535,19 @@ public: void close_active_vio(); #endif void awake(bool prepare_to_die); + /* + For enter_cond() / exit_cond() to work the mutex must be got before + enter_cond() but released before exit_cond() (in 4.1, assertions will soon + ensure this). Use must be: + lock mutex; enter_cond(); ...; unlock mutex; exit_cond(). + If you don't do it this way, you will get a deadlock if another thread is + doing a THD::awake() on you. + + */ inline const char* enter_cond(pthread_cond_t *cond, pthread_mutex_t* mutex, const char* msg) { const char* old_msg = proc_info; - safe_mutex_assert_owner(mutex); mysys_var->current_mutex = mutex; mysys_var->current_cond = cond; proc_info = msg;