MySQL 9.1.0
Source Code Documentation
lock0priv.ic File Reference

Lock module internal inline methods. More...

Functions

static uint32_t lock_get_type_low (const lock_t *lock)
 Gets the type of a lock. More...
 
static trx_id_t lock_clust_rec_some_has_impl (const rec_t *rec, const dict_index_t *index, const ulint *offsets)
 
static uint32_t lock_rec_get_n_bits (const lock_t *lock)
 
static void lock_rec_set_nth_bit (lock_t *lock, ulint i)
 Sets the nth bit of a record lock to true. More...
 
static bool lock_rec_get_nth_bit (const lock_t *lock, ulint i)
 Gets the nth bit of a record lock. More...
 
static enum lock_mode lock_get_mode (const lock_t *lock)
 Gets the mode of a lock. More...
 
static ulint lock_mode_compatible (enum lock_mode mode1, enum lock_mode mode2)
 Calculates if lock mode 1 is compatible with lock mode 2. More...
 
static bool lock_mode_stronger_or_eq (enum lock_mode mode1, enum lock_mode mode2)
 
static ulint lock_get_wait (const lock_t *lock)
 Gets the wait flag of a lock. More...
 
static void lock_reset_lock_and_trx_wait (lock_t *lock)
 The back pointer to a waiting lock request in the transaction is set to NULL and the wait bit in lock type_mode is reset. More...
 
static bool lock_table_has (const trx_t *trx, const dict_table_t *table, lock_mode in_mode)
 

Detailed Description

Lock module internal inline methods.

Created July 16, 2007 Vasil Dimov

Function Documentation

◆ lock_clust_rec_some_has_impl()

static trx_id_t lock_clust_rec_some_has_impl ( const rec_t rec,
const dict_index_t index,
const ulint offsets 
)
inlinestatic

◆ lock_get_mode()

static enum lock_mode lock_get_mode ( const lock_t lock)
inlinestatic

Gets the mode of a lock.

Returns
mode
Parameters
lockin: lock

◆ lock_get_type_low()

static uint32_t lock_get_type_low ( const lock_t lock)
inlinestatic

Gets the type of a lock.

Returns
LOCK_TABLE or LOCK_REC
Parameters
lockin: lock

◆ lock_get_wait()

static ulint lock_get_wait ( const lock_t lock)
inlinestatic

Gets the wait flag of a lock.

Returns
LOCK_WAIT if waiting, 0 if not
Parameters
lockin: lock

◆ lock_mode_compatible()

static ulint lock_mode_compatible ( enum lock_mode  mode1,
enum lock_mode  mode2 
)
inlinestatic

Calculates if lock mode 1 is compatible with lock mode 2.

Returns
nonzero if mode1 compatible with mode2
Parameters
mode1in: lock mode
mode2in: lock mode

◆ lock_mode_stronger_or_eq()

static bool lock_mode_stronger_or_eq ( enum lock_mode  mode1,
enum lock_mode  mode2 
)
inlinestatic

◆ lock_rec_get_n_bits()

static uint32_t lock_rec_get_n_bits ( const lock_t lock)
inlinestatic

◆ lock_rec_get_nth_bit()

static bool lock_rec_get_nth_bit ( const lock_t lock,
ulint  i 
)
inlinestatic

Gets the nth bit of a record lock.

Parameters
[in]lockRecord lock
[in]iIndex of the bit to check
Returns
true if bit set also if i == ULINT_UNDEFINED return false

◆ lock_rec_set_nth_bit()

static void lock_rec_set_nth_bit ( lock_t lock,
ulint  i 
)
inlinestatic

Sets the nth bit of a record lock to true.

Parameters
lockin: record lock
iin: index of the bit

◆ lock_reset_lock_and_trx_wait()

static void lock_reset_lock_and_trx_wait ( lock_t lock)
inlinestatic

The back pointer to a waiting lock request in the transaction is set to NULL and the wait bit in lock type_mode is reset.

Parameters
lockin/out: record lock

◆ lock_table_has()

static bool lock_table_has ( const trx_t trx,
const dict_table_t table,
lock_mode  in_mode 
)
inlinestatic