MySQL 9.1.0
Source Code Documentation
thr_mutex.h File Reference

MySQL mutex implementation. More...

#include <assert.h>
#include <stddef.h>
#include <stdlib.h>
#include <sys/types.h>
#include "my_inttypes.h"
#include "my_macros.h"
#include "my_thread.h"
#include "mysql/components/services/bits/thr_mutex_bits.h"

Go to the source code of this file.

Macros

#define MY_MUTEX_INIT_SLOW   NULL
 
#define MY_MUTEX_INIT_FAST   NULL
 
#define MY_MUTEX_INIT_ERRCHK   NULL
 

Functions

static int native_mutex_init (native_mutex_t *mutex, const native_mutexattr_t *attr)
 
static int native_mutex_lock (native_mutex_t *mutex)
 
static int native_mutex_trylock (native_mutex_t *mutex)
 
static int native_mutex_unlock (native_mutex_t *mutex)
 
static int native_mutex_destroy (native_mutex_t *mutex)
 
static int my_mutex_init (my_mutex_t *mp, const native_mutexattr_t *attr)
 
static int my_mutex_lock (my_mutex_t *mp)
 
static int my_mutex_trylock (my_mutex_t *mp)
 
static int my_mutex_unlock (my_mutex_t *mp)
 
static int my_mutex_destroy (my_mutex_t *mp)
 

Detailed Description

MySQL mutex implementation.

There are three "layers": 1) native_mutex_*() Functions that map directly down to OS primitives. Windows - CriticalSection Other OSes - pthread 2) my_mutex_*() Functions that implement SAFE_MUTEX (default for debug), Otherwise native_mutex_*() is used. 3) mysql_mutex_*() Functions that include Performance Schema instrumentation. See include/mysql/psi/mysql_thread.h

Macro Definition Documentation

◆ MY_MUTEX_INIT_ERRCHK

#define MY_MUTEX_INIT_ERRCHK   NULL

◆ MY_MUTEX_INIT_FAST

#define MY_MUTEX_INIT_FAST   NULL

◆ MY_MUTEX_INIT_SLOW

#define MY_MUTEX_INIT_SLOW   NULL

Function Documentation

◆ my_mutex_destroy()

static int my_mutex_destroy ( my_mutex_t mp)
inlinestatic

◆ my_mutex_init()

static int my_mutex_init ( my_mutex_t mp,
const native_mutexattr_t attr 
)
inlinestatic

◆ my_mutex_lock()

static int my_mutex_lock ( my_mutex_t mp)
inlinestatic

◆ my_mutex_trylock()

static int my_mutex_trylock ( my_mutex_t mp)
inlinestatic

◆ my_mutex_unlock()

static int my_mutex_unlock ( my_mutex_t mp)
inlinestatic

◆ native_mutex_destroy()

static int native_mutex_destroy ( native_mutex_t mutex)
inlinestatic

◆ native_mutex_init()

static int native_mutex_init ( native_mutex_t mutex,
const native_mutexattr_t attr 
)
inlinestatic

◆ native_mutex_lock()

static int native_mutex_lock ( native_mutex_t mutex)
inlinestatic

◆ native_mutex_trylock()

static int native_mutex_trylock ( native_mutex_t mutex)
inlinestatic

◆ native_mutex_unlock()

static int native_mutex_unlock ( native_mutex_t mutex)
inlinestatic