MySQL 8.4.3
Source Code Documentation
mysql_mutex.h File Reference

Instrumentation helpers for mutexes. More...

Go to the source code of this file.

Macros

#define mysql_mutex_assert_owner(M)    {}
 Wrapper, to use safe_mutex_assert_owner with instrumented mutexes. More...
 
#define mysql_mutex_assert_not_owner(M)    {}
 Wrapper, to use safe_mutex_assert_not_owner with instrumented mutexes. More...
 
#define mysql_mutex_register(P1, P2, P3)   inline_mysql_mutex_register(P1, P2, P3)
 Mutex registration. More...
 
#define mysql_mutex_init(K, M, A)    mysql_mutex_init_with_src(K, M, A, __FILE__, __LINE__)
 Instrumented mutex_init. More...
 
#define mysql_mutex_init_with_src(K, M, A, F, L)    inline_mysql_mutex_init(K, M, A, F, L)
 
#define mysql_mutex_destroy(M)    mysql_mutex_destroy_with_src(M, __FILE__, __LINE__)
 Instrumented mutex_destroy. More...
 
#define mysql_mutex_destroy_with_src(M, F, L)    inline_mysql_mutex_destroy(M, F, L)
 
#define mysql_mutex_lock(M)   mysql_mutex_lock_with_src(M, __FILE__, __LINE__)
 Instrumented mutex_lock. More...
 
#define mysql_mutex_lock_with_src(M, F, L)   inline_mysql_mutex_lock(M, F, L)
 
#define mysql_mutex_trylock(M)    mysql_mutex_trylock_with_src(M, __FILE__, __LINE__)
 Instrumented mutex_lock. More...
 
#define mysql_mutex_trylock_with_src(M, F, L)    inline_mysql_mutex_trylock(M, F, L)
 
#define mysql_mutex_unlock(M)   mysql_mutex_unlock_with_src(M, __FILE__, __LINE__)
 Instrumented mutex_unlock. More...
 
#define mysql_mutex_unlock_with_src(M, F, L)   inline_mysql_mutex_unlock(M, F, L)
 

Functions

static void inline_mysql_mutex_register (const char *category, PSI_mutex_info *info, int count)
 
static int inline_mysql_mutex_init (PSI_mutex_key key, mysql_mutex_t *that, const native_mutexattr_t *attr, const char *src_file, uint src_line)
 
static int inline_mysql_mutex_destroy (mysql_mutex_t *that, const char *src_file, uint src_line)
 
static int inline_mysql_mutex_lock (mysql_mutex_t *that, const char *src_file, uint src_line)
 
static int inline_mysql_mutex_trylock (mysql_mutex_t *that, const char *src_file, uint src_line)
 
static int inline_mysql_mutex_unlock (mysql_mutex_t *that, const char *src_file, uint src_line)
 

Detailed Description

Instrumentation helpers for mutexes.

This header file provides the necessary declarations to use the mutex 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.