MySQL 8.4.0
Source Code Documentation
lock0iter.cc File Reference

Lock queue iterator. More...

#include <stddef.h>
#include "dict0mem.h"
#include "lock0iter.h"
#include "lock0lock.h"
#include "lock0priv.h"
#include "univ.i"

Macros

#define LOCK_MODULE_IMPLEMENTATION
 

Functions

void lock_queue_iterator_reset (lock_queue_iterator_t *iter, const lock_t *lock, ulint bit_no)
 Initialize lock queue iterator so that it starts to iterate from "lock". More...
 
const lock_tlock_queue_iterator_get_prev (lock_queue_iterator_t *iter)
 Gets the previous lock in the lock queue, returns NULL if there are no more locks (i.e. More...
 

Detailed Description

Lock queue iterator.

Can iterate over table and record lock queues.

Created July 16, 2007 Vasil Dimov

Macro Definition Documentation

◆ LOCK_MODULE_IMPLEMENTATION

#define LOCK_MODULE_IMPLEMENTATION

Function Documentation

◆ lock_queue_iterator_get_prev()

const lock_t * lock_queue_iterator_get_prev ( lock_queue_iterator_t iter)

Gets the previous lock in the lock queue, returns NULL if there are no more locks (i.e.

the current lock is the first one). The iterator is receded (if not-NULL is returned).

Returns
previous lock or NULL
Parameters
iterin/out: iterator

◆ lock_queue_iterator_reset()

void lock_queue_iterator_reset ( lock_queue_iterator_t iter,
const lock_t lock,
ulint  bit_no 
)

Initialize lock queue iterator so that it starts to iterate from "lock".

bit_no specifies the record number within the heap where the record is stored. It can be undefined (ULINT_UNDEFINED) in two cases:

  1. If the lock is a table lock, thus we have a table lock queue;
  2. If the lock is a record lock and it is a wait lock. In this case bit_no is calculated in this function by using lock_rec_find_set_bit(). There is exactly one bit set in the bitmap of a wait lock.
Parameters
iterout: iterator
lockin: lock to start from
bit_noin: record number in the heap