1
/******************************************************
2
Lock queue iterator type and function prototypes.
6
Created July 16, 2007 Vasil Dimov
7
*******************************************************/
13
#include "lock0types.h"
15
typedef struct lock_queue_iterator_struct {
17
/* In case this is a record lock queue (not table lock queue)
18
then bit_no is the record number within the heap in which the
21
} lock_queue_iterator_t;
23
/***********************************************************************
24
Initialize lock queue iterator so that it starts to iterate from
25
"lock". bit_no specifies the record number within the heap where the
26
record is stored. It can be undefined (ULINT_UNDEFINED) in two cases:
27
1. If the lock is a table lock, thus we have a table lock queue;
28
2. If the lock is a record lock and it is a wait lock. In this case
29
bit_no is calculated in this function by using
30
lock_rec_find_set_bit(). There is exactly one bit set in the bitmap
34
lock_queue_iterator_reset(
35
/*======================*/
36
lock_queue_iterator_t* iter, /* out: iterator */
37
lock_t* lock, /* in: lock to start from */
38
ulint bit_no);/* in: record number in the
41
/***********************************************************************
42
Gets the previous lock in the lock queue, returns NULL if there are no
43
more locks (i.e. the current lock is the first one). The iterator is
44
receded (if not-NULL is returned). */
47
lock_queue_iterator_get_prev(
48
/*=========================*/
49
/* out: previous lock or NULL */
50
lock_queue_iterator_t* iter); /* in/out: iterator */
52
#endif /* lock0iter_h */