MySQL  8.0.26
Source Code Documentation
thr_rwlock.h File Reference

MySQL rwlock implementation. More...

#include <assert.h>
#include <stddef.h>
#include <sys/types.h>
#include "my_inttypes.h"
#include "my_macros.h"
#include "my_thread.h"
#include "mysql/components/services/thr_rwlock_bits.h"
#include "thr_cond.h"
#include "thr_mutex.h"

Go to the source code of this file.

Functions

static int native_rw_init (native_rw_lock_t *rwp)
 
static int native_rw_destroy (native_rw_lock_t *rwp)
 
static int native_rw_rdlock (native_rw_lock_t *rwp)
 
static int native_rw_tryrdlock (native_rw_lock_t *rwp)
 
static int native_rw_wrlock (native_rw_lock_t *rwp)
 
static int native_rw_trywrlock (native_rw_lock_t *rwp)
 
static int native_rw_unlock (native_rw_lock_t *rwp)
 
int rw_pr_init (rw_pr_lock_t *)
 
int rw_pr_rdlock (rw_pr_lock_t *)
 
int rw_pr_wrlock (rw_pr_lock_t *)
 
int rw_pr_unlock (rw_pr_lock_t *)
 
int rw_pr_destroy (rw_pr_lock_t *)
 

Detailed Description

MySQL rwlock implementation.

There are two "layers": 1) native_rw_*() Functions that map directly down to OS primitives. Windows - SRWLock Other OSes - pthread 2) mysql_rw*() Functions that include Performance Schema instrumentation. See include/mysql/psi/mysql_thread.h

This file also includes rw_pr_*(), which implements a special version of rwlocks that prefer readers. The P_S version of these are mysql_prlock_*() - see include/mysql/psi/mysql_thread.h

Function Documentation

◆ native_rw_destroy()

static int native_rw_destroy ( native_rw_lock_t rwp)
inlinestatic

◆ native_rw_init()

static int native_rw_init ( native_rw_lock_t rwp)
inlinestatic

◆ native_rw_rdlock()

static int native_rw_rdlock ( native_rw_lock_t rwp)
inlinestatic

◆ native_rw_tryrdlock()

static int native_rw_tryrdlock ( native_rw_lock_t rwp)
inlinestatic

◆ native_rw_trywrlock()

static int native_rw_trywrlock ( native_rw_lock_t rwp)
inlinestatic

◆ native_rw_unlock()

static int native_rw_unlock ( native_rw_lock_t rwp)
inlinestatic

◆ native_rw_wrlock()

static int native_rw_wrlock ( native_rw_lock_t rwp)
inlinestatic

◆ rw_pr_destroy()

int rw_pr_destroy ( rw_pr_lock_t rwlock)

◆ rw_pr_init()

int rw_pr_init ( rw_pr_lock_t rwlock)

◆ rw_pr_rdlock()

int rw_pr_rdlock ( rw_pr_lock_t rwlock)

◆ rw_pr_unlock()

int rw_pr_unlock ( rw_pr_lock_t rwlock)

◆ rw_pr_wrlock()

int rw_pr_wrlock ( rw_pr_lock_t rwlock)