~drizzle-trunk/drizzle/development

641.2.2 by Monty Taylor
InnoDB Plugin 1.0.3
1
/*****************************************************************************
2
1999.6.1 by kalebral at gmail
update Copyright strings to a more common format to help with creating the master debian copyright file
3
Copyright (C) 2007, 2009, Innobase Oy. All Rights Reserved.
641.2.2 by Monty Taylor
InnoDB Plugin 1.0.3
4
5
This program is free software; you can redistribute it and/or modify it under
6
the terms of the GNU General Public License as published by the Free Software
7
Foundation; version 2 of the License.
8
9
This program is distributed in the hope that it will be useful, but WITHOUT
10
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
13
You should have received a copy of the GNU General Public License along with
1802.10.2 by Monty Taylor
Update all of the copyright headers to include the correct address.
14
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
15
St, Fifth Floor, Boston, MA 02110-1301 USA
641.2.2 by Monty Taylor
InnoDB Plugin 1.0.3
16
17
*****************************************************************************/
18
641.2.3 by Monty Taylor
InnoDB Plugin 1.0.4
19
/**************************************************//**
20
@file include/lock0iter.h
641.1.2 by Monty Taylor
Imported 1.0.1 with clean - with no changes.
21
Lock queue iterator type and function prototypes.
22
23
Created July 16, 2007 Vasil Dimov
24
*******************************************************/
25
2234 by Brian Aker
Mass removal of ifdef/endif in favor of pragma once.
26
#pragma once
641.1.2 by Monty Taylor
Imported 1.0.1 with clean - with no changes.
27
#ifndef lock0iter_h
28
#define lock0iter_h
29
30
#include "univ.i"
31
#include "lock0types.h"
32
33
typedef struct lock_queue_iterator_struct {
34
	const lock_t*	current_lock;
35
	/* In case this is a record lock queue (not table lock queue)
36
	then bit_no is the record number within the heap in which the
37
	record is stored. */
38
	ulint		bit_no;
39
} lock_queue_iterator_t;
40
641.2.3 by Monty Taylor
InnoDB Plugin 1.0.4
41
/*******************************************************************//**
641.1.2 by Monty Taylor
Imported 1.0.1 with clean - with no changes.
42
Initialize lock queue iterator so that it starts to iterate from
43
"lock". bit_no specifies the record number within the heap where the
44
record is stored. It can be undefined (ULINT_UNDEFINED) in two cases:
45
1. If the lock is a table lock, thus we have a table lock queue;
46
2. If the lock is a record lock and it is a wait lock. In this case
47
   bit_no is calculated in this function by using
48
   lock_rec_find_set_bit(). There is exactly one bit set in the bitmap
49
   of a wait lock. */
50
UNIV_INTERN
51
void
52
lock_queue_iterator_reset(
53
/*======================*/
641.2.3 by Monty Taylor
InnoDB Plugin 1.0.4
54
	lock_queue_iterator_t*	iter,	/*!< out: iterator */
55
	const lock_t*		lock,	/*!< in: lock to start from */
56
	ulint			bit_no);/*!< in: record number in the
641.1.2 by Monty Taylor
Imported 1.0.1 with clean - with no changes.
57
					heap */
58
641.2.3 by Monty Taylor
InnoDB Plugin 1.0.4
59
/*******************************************************************//**
641.1.2 by Monty Taylor
Imported 1.0.1 with clean - with no changes.
60
Gets the previous lock in the lock queue, returns NULL if there are no
61
more locks (i.e. the current lock is the first one). The iterator is
641.2.3 by Monty Taylor
InnoDB Plugin 1.0.4
62
receded (if not-NULL is returned).
63
@return	previous lock or NULL */
641.1.2 by Monty Taylor
Imported 1.0.1 with clean - with no changes.
64
65
const lock_t*
66
lock_queue_iterator_get_prev(
67
/*=========================*/
641.2.3 by Monty Taylor
InnoDB Plugin 1.0.4
68
	lock_queue_iterator_t*	iter);	/*!< in/out: iterator */
641.1.2 by Monty Taylor
Imported 1.0.1 with clean - with no changes.
69
70
#endif /* lock0iter_h */