diff --git a/plugin/thread_pool/threadpool_unix.cc b/plugin/thread_pool/threadpool_unix.cc index 707fbd54c7476e05f57399d11501d822c0b766a1..8e608c80fd0680bf3febb68479ae1e9327ee8c41 100644 --- a/plugin/thread_pool/threadpool_unix.cc +++ b/plugin/thread_pool/threadpool_unix.cc @@ -115,18 +115,26 @@ static void connection_abort(connection_t *connection); static void set_next_timeout_check(ulonglong abstime); static void print_pool_blocked_message(bool) noexcept; +static void tp_lock_plugin_mutex() { + mysql_mutex_lock(&LOCK_plugin); +} + +static void tp_unlock_plugin_mutex() { + mysql_mutex_unlock(&LOCK_plugin); +} + static void tp_inc_ref_count() { - lock_plugin_mutex(); + tp_lock_plugin_mutex(); assert(gPluginPtr != nullptr); gPluginPtr->ref_count++; - unlock_plugin_mutex(); + tp_unlock_plugin_mutex(); } static void tp_dec_ref_count() { - lock_plugin_mutex(); + tp_lock_plugin_mutex(); assert(gPluginPtr != nullptr); gPluginPtr->ref_count--; - unlock_plugin_mutex(); + tp_unlock_plugin_mutex(); } class ThreadPoolConnSet {