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