Commit 539a7ebe authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

LP909537: Ensure thd_wait_begin/thd_wait_end callbacks are called.

parent 8d90582a
...@@ -3927,9 +3927,7 @@ extern "C" bool thd_sqlcom_can_generate_row_events(const MYSQL_THD thd) ...@@ -3927,9 +3927,7 @@ extern "C" bool thd_sqlcom_can_generate_row_events(const MYSQL_THD thd)
return sqlcom_can_generate_row_events(thd); return sqlcom_can_generate_row_events(thd);
} }
#ifdef NOT_USED /* we'll do the correctly instead */
extern "C" void thd_pool_wait_begin(MYSQL_THD thd, int wait_type);
extern "C" void thd_pool_wait_end(MYSQL_THD thd);
/* /*
Interface for MySQL Server, plugins and storage engines to report Interface for MySQL Server, plugins and storage engines to report
...@@ -3954,6 +3952,9 @@ extern "C" void thd_pool_wait_end(MYSQL_THD thd); ...@@ -3954,6 +3952,9 @@ extern "C" void thd_pool_wait_end(MYSQL_THD thd);
*/ */
extern "C" void thd_wait_begin(MYSQL_THD thd, int wait_type) extern "C" void thd_wait_begin(MYSQL_THD thd, int wait_type)
{ {
if(!thd)
thd= current_thd;
if (thd)
MYSQL_CALLBACK(thd->scheduler, thd_wait_begin, (thd, wait_type)); MYSQL_CALLBACK(thd->scheduler, thd_wait_begin, (thd, wait_type));
} }
...@@ -3965,21 +3966,12 @@ extern "C" void thd_wait_begin(MYSQL_THD thd, int wait_type) ...@@ -3965,21 +3966,12 @@ extern "C" void thd_wait_begin(MYSQL_THD thd, int wait_type)
*/ */
extern "C" void thd_wait_end(MYSQL_THD thd) extern "C" void thd_wait_end(MYSQL_THD thd)
{ {
if(!thd)
thd= current_thd;
if (thd)
MYSQL_CALLBACK(thd->scheduler, thd_wait_end, (thd)); MYSQL_CALLBACK(thd->scheduler, thd_wait_end, (thd));
} }
#else
extern "C" void thd_wait_begin(MYSQL_THD thd, int wait_type)
{
/* do NOTHING for the embedded library */
return;
}
extern "C" void thd_wait_end(MYSQL_THD thd)
{
/* do NOTHING for the embedded library */
return;
}
#endif
#endif // INNODB_COMPATIBILITY_HOOKS */ #endif // INNODB_COMPATIBILITY_HOOKS */
/**************************************************************************** /****************************************************************************
......
...@@ -845,7 +845,7 @@ static void post_event(thread_group_t *thread_group, pool_event_t* ev) ...@@ -845,7 +845,7 @@ static void post_event(thread_group_t *thread_group, pool_event_t* ev)
*/ */
static bool too_many_threads(thread_group_t *thread_group) static bool too_many_threads(thread_group_t *thread_group)
{ {
return (thread_group->active_thread_count > 4 && !thread_group->stalled); return (thread_group->active_thread_count >= 4 && !thread_group->stalled);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment