diff options
Diffstat (limited to 'sql')
-rw-r--r-- | sql/sql_class.cc | 26 | ||||
-rw-r--r-- | sql/threadpool_unix.cc | 2 |
2 files changed, 10 insertions, 18 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc index edb7fe6c71e..cd29d706823 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -3927,9 +3927,7 @@ extern "C" bool thd_sqlcom_can_generate_row_events(const MYSQL_THD 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 @@ -3954,7 +3952,10 @@ extern "C" void thd_pool_wait_end(MYSQL_THD thd); */ extern "C" void thd_wait_begin(MYSQL_THD thd, int wait_type) { - MYSQL_CALLBACK(thd->scheduler, thd_wait_begin, (thd, wait_type)); + if(!thd) + thd= current_thd; + if (thd) + 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) */ extern "C" void thd_wait_end(MYSQL_THD 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; + if(!thd) + thd= current_thd; + if (thd) + MYSQL_CALLBACK(thd->scheduler, thd_wait_end, (thd)); } -extern "C" void thd_wait_end(MYSQL_THD thd) -{ - /* do NOTHING for the embedded library */ - return; -} -#endif #endif // INNODB_COMPATIBILITY_HOOKS */ /**************************************************************************** diff --git a/sql/threadpool_unix.cc b/sql/threadpool_unix.cc index b9cf4c61b7e..32847e91a32 100644 --- a/sql/threadpool_unix.cc +++ b/sql/threadpool_unix.cc @@ -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) { - return (thread_group->active_thread_count > 4 && !thread_group->stalled); + return (thread_group->active_thread_count >= 4 && !thread_group->stalled); } |