mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Auto-merge from mysql-next-mr.
This commit is contained in:
@ -274,12 +274,7 @@ const char* thd_enter_cond(MYSQL_THD thd, pthread_cond_t *cond,
|
||||
if (!thd)
|
||||
thd= current_thd;
|
||||
|
||||
const char* old_msg = thd->proc_info;
|
||||
safe_mutex_assert_owner(mutex);
|
||||
thd->mysys_var->current_mutex = mutex;
|
||||
thd->mysys_var->current_cond = cond;
|
||||
thd->proc_info = msg;
|
||||
return old_msg;
|
||||
return thd->enter_cond(cond, mutex, msg);
|
||||
}
|
||||
|
||||
extern "C"
|
||||
@ -288,18 +283,7 @@ void thd_exit_cond(MYSQL_THD thd, const char *old_msg)
|
||||
if (!thd)
|
||||
thd= current_thd;
|
||||
|
||||
/*
|
||||
Putting the mutex unlock in thd_exit_cond() ensures that
|
||||
mysys_var->current_mutex is always unlocked _before_ mysys_var->mutex is
|
||||
locked (if that would not be the case, you'll get a deadlock if someone
|
||||
does a THD::awake() on you).
|
||||
*/
|
||||
pthread_mutex_unlock(thd->mysys_var->current_mutex);
|
||||
pthread_mutex_lock(&thd->mysys_var->mutex);
|
||||
thd->mysys_var->current_mutex = 0;
|
||||
thd->mysys_var->current_cond = 0;
|
||||
thd->proc_info = old_msg;
|
||||
pthread_mutex_unlock(&thd->mysys_var->mutex);
|
||||
thd->exit_cond(old_msg);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user