1
/******************************************************
2
Lock module internal structures and methods.
6
Created July 12, 2007 Vasil Dimov
7
*******************************************************/
12
#ifndef LOCK_MODULE_IMPLEMENTATION
13
/* If you need to access members of the structures defined in this
14
file, please write appropriate functions that retrieve them and put
15
those functions in lock/ */
16
#error Do not include lock0priv.h outside of the lock/ module
20
#include "dict0types.h"
21
#include "hash0hash.h"
22
#include "trx0types.h"
26
typedef struct lock_table_struct lock_table_t;
27
struct lock_table_struct {
28
dict_table_t* table; /* database table in dictionary
30
UT_LIST_NODE_T(lock_t)
31
locks; /* list of locks on the same
35
/* Record lock for a page */
36
typedef struct lock_rec_struct lock_rec_t;
37
struct lock_rec_struct {
38
ulint space; /* space id */
39
ulint page_no; /* page number */
40
ulint n_bits; /* number of bits in the lock
41
bitmap; NOTE: the lock bitmap is
42
placed immediately after the
48
trx_t* trx; /* transaction owning the
50
UT_LIST_NODE_T(lock_t)
51
trx_locks; /* list of the locks of the
53
ulint type_mode; /* lock type, mode, LOCK_GAP or
55
LOCK_INSERT_INTENTION,
57
hash_node_t hash; /* hash chain node for a record
59
dict_index_t* index; /* index for a record lock */
61
lock_table_t tab_lock;/* table lock */
62
lock_rec_t rec_lock;/* record lock */
66
/*************************************************************************
67
Gets the type of a lock. */
72
/* out: LOCK_TABLE or LOCK_REC */
73
const lock_t* lock); /* in: lock */
75
/**************************************************************************
76
Looks for a set bit in a record lock bitmap. Returns ULINT_UNDEFINED,
80
lock_rec_find_set_bit(
81
/*==================*/
82
/* out: bit index == heap number of the record, or
83
ULINT_UNDEFINED if none found */
84
lock_t* lock); /* in: record lock with at least one bit set */
86
/*************************************************************************
87
Gets the previous record lock set on a record. */
92
/* out: previous lock on the same record, NULL if
94
lock_t* in_lock,/* in: record lock */
95
ulint heap_no);/* in: heap number of the record */
98
#include "lock0priv.ic"
101
#endif /* lock0priv_h */