00001 /***************************************************************************** 00002 00003 Copyright (C) 2007, 2009, Innobase Oy. All Rights Reserved. 00004 00005 This program is free software; you can redistribute it and/or modify it under 00006 the terms of the GNU General Public License as published by the Free Software 00007 Foundation; version 2 of the License. 00008 00009 This program is distributed in the hope that it will be useful, but WITHOUT 00010 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00011 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 00012 00013 You should have received a copy of the GNU General Public License along with 00014 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin 00015 St, Fifth Floor, Boston, MA 02110-1301 USA 00016 00017 *****************************************************************************/ 00018 00019 /**************************************************/ 00026 #pragma once 00027 #ifndef lock0priv_h 00028 #define lock0priv_h 00029 00030 #ifndef LOCK_MODULE_IMPLEMENTATION 00031 /* If you need to access members of the structures defined in this 00032 file, please write appropriate functions that retrieve them and put 00033 those functions in lock/ */ 00034 #error Do not include lock0priv.h outside of the lock/ module 00035 #endif 00036 00037 #include "univ.i" 00038 #include "dict0types.h" 00039 #include "hash0hash.h" 00040 #include "trx0types.h" 00041 #include "ut0lst.h" 00042 00044 typedef struct lock_table_struct lock_table_t; 00046 struct lock_table_struct { 00047 dict_table_t* table; 00049 UT_LIST_NODE_T(lock_t) 00050 locks; 00052 }; 00053 00055 typedef struct lock_rec_struct lock_rec_t; 00057 struct lock_rec_struct { 00058 ulint space; 00059 ulint page_no; 00060 ulint n_bits; 00064 }; 00065 00067 struct lock_struct { 00068 trx_t* trx; 00070 UT_LIST_NODE_T(lock_t) 00071 trx_locks; 00073 ulint type_mode; 00077 hash_node_t hash; 00079 dict_index_t* index; 00080 union { 00081 lock_table_t tab_lock; 00082 lock_rec_t rec_lock; 00083 } un_member; 00084 }; 00085 00086 /*********************************************************************/ 00089 UNIV_INLINE 00090 ulint 00091 lock_get_type_low( 00092 /*==============*/ 00093 const lock_t* lock); 00095 /*********************************************************************/ 00098 UNIV_INTERN 00099 const lock_t* 00100 lock_rec_get_prev( 00101 /*==============*/ 00102 const lock_t* in_lock, 00103 ulint heap_no); 00105 #ifndef UNIV_NONINL 00106 #include "lock0priv.ic" 00107 #endif 00108 00109 #endif /* lock0priv_h */