Commit 1af2dbed authored by vasil's avatar vasil

Move lock_*struct structures from lock/lock0lock.c to include/lock0priv.h.

This is needed in order to add more code to lock/ that uses members of
these structures (internal to the lock module) but in a separate file,
rather than lock0lock.c. lock0lock.c is a way too big already.

Approved by:	Sunny
parent cc454ad4
/******************************************************
Definition of the lock module internal structures.
(c) 2007 Innobase Oy
Created 12/07/2007 Vasil Dimov
*******************************************************/
#ifndef lock0priv_h
#define lock0priv_h
#ifndef LOCK_MODULE_IMPLEMENTATION
/* If you need to access members of the structures defined in this
file, please write appropriate functions that retrieve them and put
those functions in lock/ */
#error Do not include lock0priv.h outside of the lock/ module
#endif
#include "univ.i"
#include "dict0types.h"
#include "hash0hash.h"
#include "trx0types.h"
#include "ut0lst.h"
/* A table lock */
typedef struct lock_table_struct lock_table_t;
struct lock_table_struct{
dict_table_t* table; /* database table in dictionary cache */
UT_LIST_NODE_T(lock_t)
locks; /* list of locks on the same table */
};
/* Record lock for a page */
typedef struct lock_rec_struct lock_rec_t;
struct lock_rec_struct{
ulint space; /* space id */
ulint page_no; /* page number */
ulint n_bits; /* number of bits in the lock bitmap */
/* NOTE: the lock bitmap is placed immediately
after the lock struct */
};
/* Lock struct */
struct lock_struct{
trx_t* trx; /* transaction owning the lock */
UT_LIST_NODE_T(lock_t)
trx_locks; /* list of the locks of the
transaction */
ulint type_mode; /* lock type, mode, LOCK_GAP or
LOCK_REC_NOT_GAP,
LOCK_INSERT_INTENTION,
wait flag, ORed */
hash_node_t hash; /* hash chain node for a record lock */
dict_index_t* index; /* index for a record lock */
union {
lock_table_t tab_lock;/* table lock */
lock_rec_t rec_lock;/* record lock */
} un_member;
};
#endif /* lock0priv_h */
...@@ -6,7 +6,10 @@ The transaction lock system ...@@ -6,7 +6,10 @@ The transaction lock system
Created 5/7/1996 Heikki Tuuri Created 5/7/1996 Heikki Tuuri
*******************************************************/ *******************************************************/
#define LOCK_MODULE_IMPLEMENTATION
#include "lock0lock.h" #include "lock0lock.h"
#include "lock0priv.h"
#ifdef UNIV_NONINL #ifdef UNIV_NONINL
#include "lock0lock.ic" #include "lock0lock.ic"
...@@ -319,42 +322,6 @@ ibool lock_print_waits = FALSE; ...@@ -319,42 +322,6 @@ ibool lock_print_waits = FALSE;
/* The lock system */ /* The lock system */
lock_sys_t* lock_sys = NULL; lock_sys_t* lock_sys = NULL;
/* A table lock */
typedef struct lock_table_struct lock_table_t;
struct lock_table_struct{
dict_table_t* table; /* database table in dictionary cache */
UT_LIST_NODE_T(lock_t)
locks; /* list of locks on the same table */
};
/* Record lock for a page */
typedef struct lock_rec_struct lock_rec_t;
struct lock_rec_struct{
ulint space; /* space id */
ulint page_no; /* page number */
ulint n_bits; /* number of bits in the lock bitmap */
/* NOTE: the lock bitmap is placed immediately
after the lock struct */
};
/* Lock struct */
struct lock_struct{
trx_t* trx; /* transaction owning the lock */
UT_LIST_NODE_T(lock_t)
trx_locks; /* list of the locks of the
transaction */
ulint type_mode; /* lock type, mode, LOCK_GAP or
LOCK_REC_NOT_GAP,
LOCK_INSERT_INTENTION,
wait flag, ORed */
hash_node_t hash; /* hash chain node for a record lock */
dict_index_t* index; /* index for a record lock */
union {
lock_table_t tab_lock;/* table lock */
lock_rec_t rec_lock;/* record lock */
} un_member;
};
/* We store info on the latest deadlock error to this buffer. InnoDB /* We store info on the latest deadlock error to this buffer. InnoDB
Monitor will then fetch it and print */ Monitor will then fetch it and print */
ibool lock_deadlock_found = FALSE; ibool lock_deadlock_found = FALSE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment