mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Simplify thd_wait_begin. given how seldom they are called, calling current_thd one more time is not going to be anything performance relevant.
Also use thd_wait_begin/end for thr_lock and sync callbacks.
This commit is contained in:
@ -3935,13 +3935,10 @@ extern "C" bool thd_sqlcom_can_generate_row_events(const MYSQL_THD thd)
|
||||
*/
|
||||
extern "C" void thd_wait_begin(MYSQL_THD thd, int wait_type)
|
||||
{
|
||||
|
||||
if (unlikely(!thread_scheduler) || !thread_scheduler->thd_wait_begin)
|
||||
return;
|
||||
if (thd == NULL)
|
||||
if (!thd)
|
||||
{
|
||||
thd=current_thd;
|
||||
if(unlikely(thd == NULL))
|
||||
thd= current_thd;
|
||||
if (unlikely(!thd))
|
||||
return;
|
||||
}
|
||||
MYSQL_CALLBACK(thd->scheduler, thd_wait_begin, (thd, wait_type));
|
||||
@ -3956,16 +3953,13 @@ extern "C" void thd_wait_begin(MYSQL_THD thd, int wait_type)
|
||||
*/
|
||||
extern "C" void thd_wait_end(MYSQL_THD thd)
|
||||
{
|
||||
if (unlikely(!thread_scheduler) || ! thread_scheduler->thd_wait_begin)
|
||||
return;
|
||||
if (thd == NULL)
|
||||
if (!thd)
|
||||
{
|
||||
thd=current_thd;
|
||||
if(unlikely(thd == NULL))
|
||||
thd= current_thd;
|
||||
if (unlikely(!thd))
|
||||
return;
|
||||
}
|
||||
if(likely(thd->scheduler == thread_scheduler))
|
||||
thread_scheduler->thd_wait_end(thd);
|
||||
MYSQL_CALLBACK(thd->scheduler, thd_wait_end, (thd));
|
||||
}
|
||||
|
||||
#endif // INNODB_COMPATIBILITY_HOOKS */
|
||||
|
Reference in New Issue
Block a user