MySQL 8.4.1
Source Code Documentation
lock0iter.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 2007, 2024, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is designed to work with certain software (including
10but not limited to OpenSSL) that is licensed under separate terms,
11as designated in a particular file or component or in included license
12documentation. The authors of MySQL hereby grant you an additional
13permission to link the program and your derivative works with the
14separately licensed software that they have either included with
15the program or referenced in the documentation.
16
17This program is distributed in the hope that it will be useful, but WITHOUT
18ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
20for more details.
21
22You should have received a copy of the GNU General Public License along with
23this program; if not, write to the Free Software Foundation, Inc.,
2451 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25
26*****************************************************************************/
27
28/** @file include/lock0iter.h
29 Lock queue iterator type and function prototypes.
30
31 Created July 16, 2007 Vasil Dimov
32 *******************************************************/
33
34#ifndef lock0iter_h
35#define lock0iter_h
36
37#include "lock0types.h"
38#include "univ.i"
39
42 /* In case this is a record lock queue (not table lock queue)
43 then bit_no is the record number within the heap in which the
44 record is stored. */
46};
47
48/** Initialize lock queue iterator so that it starts to iterate from
49 "lock". bit_no specifies the record number within the heap where the
50 record is stored. It can be undefined (ULINT_UNDEFINED) in two cases:
51 1. If the lock is a table lock, thus we have a table lock queue;
52 2. If the lock is a record lock and it is a wait lock. In this case
53 bit_no is calculated in this function by using
54 lock_rec_find_set_bit(). There is exactly one bit set in the bitmap
55 of a wait lock. */
57 lock_queue_iterator_t *iter, /*!< out: iterator */
58 const lock_t *lock, /*!< in: lock to start from */
59 ulint bit_no); /*!< in: record number in the
60 heap */
61
62/** Gets the previous lock in the lock queue, returns NULL if there are no
63 more locks (i.e. the current lock is the first one). The iterator is
64 receded (if not-NULL is returned).
65 @return previous lock or NULL */
67 lock_queue_iterator_t *iter); /*!< in/out: iterator */
68
69#endif /* lock0iter_h */
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".
Definition: lock0iter.cc:53
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....
Definition: lock0iter.cc:85
The transaction lock system global types.
Provides atomic access in shared-exclusive modes.
Definition: shared_spin_lock.h:79
Definition: lock0iter.h:40
ulint bit_no
Definition: lock0iter.h:45
const lock_t * current_lock
Definition: lock0iter.h:41
Lock struct; protected by lock_sys latches.
Definition: lock0priv.h:136
Version control for database, common definitions, and include files.
unsigned long int ulint
Definition: univ.i:406