mirror of
https://github.com/MariaDB/server.git
synced 2025-01-27 17:33:44 +01:00
Move lock_get_type() from lock/lock0lock.c to include/lock0priv.ic:
* lock0lock.c: remove lock_get_type() and include include/lock0priv.ic * lock0priv.h: include lock0priv.ic and add lock_get_type() prototype * Makefile.am: add lock0priv.ic to noinst_HEADERS * lock0priv.ic: introduce this new file containing the body of lock_get_type() This move is necessary in order to use lock_get_type() from other lock/ source files (it's going to be used in lock/lock0iter.c). Approved by: Heikki
This commit is contained in:
parent
2154f6e499
commit
eb0b8ef99d
4 changed files with 47 additions and 15 deletions
|
@ -56,7 +56,7 @@ noinst_HEADERS = include/btr0btr.h include/btr0btr.ic \
|
|||
include/hash0hash.ic include/ibuf0ibuf.h \
|
||||
include/ibuf0ibuf.ic include/ibuf0types.h \
|
||||
include/lock0lock.h include/lock0lock.ic \
|
||||
include/lock0priv.h \
|
||||
include/lock0priv.h include/lock0priv.ic \
|
||||
include/lock0types.h include/log0log.h \
|
||||
include/log0log.ic include/log0recv.h \
|
||||
include/log0recv.ic include/mach0data.h \
|
||||
|
|
|
@ -63,6 +63,15 @@ struct lock_struct {
|
|||
} un_member;
|
||||
};
|
||||
|
||||
/*************************************************************************
|
||||
Gets the type of a lock. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
lock_get_type(
|
||||
/*==========*/
|
||||
/* out: LOCK_TABLE or LOCK_REC */
|
||||
const lock_t* lock); /* in: lock */
|
||||
|
||||
/**************************************************************************
|
||||
Looks for a set bit in a record lock bitmap. Returns ULINT_UNDEFINED,
|
||||
if none found. */
|
||||
|
@ -85,4 +94,8 @@ lock_rec_get_prev(
|
|||
lock_t* in_lock,/* in: record lock */
|
||||
ulint heap_no);/* in: heap number of the record */
|
||||
|
||||
#ifndef UNIV_NONINL
|
||||
#include "lock0priv.ic"
|
||||
#endif
|
||||
|
||||
#endif /* lock0priv_h */
|
||||
|
|
32
include/lock0priv.ic
Normal file
32
include/lock0priv.ic
Normal file
|
@ -0,0 +1,32 @@
|
|||
/******************************************************
|
||||
Lock module internal inline methods.
|
||||
|
||||
(c) 2007 Innobase Oy
|
||||
|
||||
Created 16/07/2007 Vasil Dimov
|
||||
*******************************************************/
|
||||
|
||||
/* This file contains only methods which are used in
|
||||
lock/lock0* files, other than lock/lock0lock.c.
|
||||
I.e. lock/lock0lock.c contains more internal inline
|
||||
methods but they are used only in that file. */
|
||||
|
||||
#ifndef LOCK_MODULE_IMPLEMENTATION
|
||||
#error Do not include lock0priv.ic outside of the lock/ module
|
||||
#endif
|
||||
|
||||
/*************************************************************************
|
||||
Gets the type of a lock. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
lock_get_type(
|
||||
/*==========*/
|
||||
/* out: LOCK_TABLE or LOCK_REC */
|
||||
const lock_t* lock) /* in: lock */
|
||||
{
|
||||
ut_ad(lock);
|
||||
|
||||
return(lock->type_mode & LOCK_TYPE_MASK);
|
||||
}
|
||||
|
||||
/* vim: set filetype=c: */
|
|
@ -13,6 +13,7 @@ Created 5/7/1996 Heikki Tuuri
|
|||
|
||||
#ifdef UNIV_NONINL
|
||||
#include "lock0lock.ic"
|
||||
#include "lock0priv.ic"
|
||||
#endif
|
||||
|
||||
#include "usr0sess.h"
|
||||
|
@ -367,20 +368,6 @@ lock_deadlock_recursive(
|
|||
LOCK_MAX_DEPTH_IN_DEADLOCK_CHECK, we
|
||||
return LOCK_VICTIM_IS_START */
|
||||
|
||||
/*************************************************************************
|
||||
Gets the type of a lock. */
|
||||
UNIV_INLINE
|
||||
ulint
|
||||
lock_get_type(
|
||||
/*==========*/
|
||||
/* out: LOCK_TABLE or LOCK_REC */
|
||||
const lock_t* lock) /* in: lock */
|
||||
{
|
||||
ut_ad(lock);
|
||||
|
||||
return(lock->type_mode & LOCK_TYPE_MASK);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
Gets the nth bit of a record lock. */
|
||||
UNIV_INLINE
|
||||
|
|
Loading…
Add table
Reference in a new issue