MySQL  8.0.19
Source Code Documentation
mysql_thread.h File Reference
#include "my_psi_config.h"
#include "my_thread.h"
#include "my_thread_local.h"
#include "mysql/psi/psi_thread.h"
#include "pfs_thread_provider.h"

Go to the source code of this file.


#define mysql_thread_register(P1, P2, P3)   inline_mysql_thread_register(P1, P2, P3)
#define mysql_thread_create(K, P1, P2, P3, P4)   inline_mysql_thread_create(K, P1, P2, P3, P4)
#define mysql_thread_set_psi_id(I)   inline_mysql_thread_set_psi_id(I)
#define mysql_thread_set_psi_THD(T)   inline_mysql_thread_set_psi_THD(T)


static void inline_mysql_thread_register (const char *category, PSI_thread_info *info, int count)
static int inline_mysql_thread_create (PSI_thread_key key, my_thread_handle *thread, const my_thread_attr_t *attr, my_start_routine start_routine, void *arg)
static void inline_mysql_thread_set_psi_id (my_thread_id id)
static void inline_mysql_thread_set_psi_THD (THD *thd)

Detailed Description

Instrumentation helpers for mysys threads. This header file provides the necessary declarations to use the mysys thread API with the performance schema instrumentation. In some compilers (SunStudio), 'static inline' functions, when declared but not used, are not optimized away (because they are unused) by default, so that including a static inline function from a header file does create unwanted dependencies, causing unresolved symbols at link time. Other compilers, like gcc, optimize these dependencies by default.

Since the instrumented APIs declared here are wrapper on top of my_thread / safemutex / etc APIs, including mysql/psi/mysql_thread.h assumes that the dependency on my_thread and safemutex already exists.