Commit ccd409b5 authored by vasil's avatar vasil

lock_get_type() needs to be accessed outside of the lock module, but it

is inline and accesses lock_t members.

As advised by Marko rename lock_get_type() to lock_get_type_low() and
create a public non-inline function lock_get_type() which calls
lock_get_type_low().

Approved by:	Marko
parent de61e2c1
...@@ -674,6 +674,16 @@ lock_number_of_rows_locked( ...@@ -674,6 +674,16 @@ lock_number_of_rows_locked(
/*=======================*/ /*=======================*/
trx_t* trx); /* in: transaction */ trx_t* trx); /* in: transaction */
/***********************************************************************
Gets the type of a lock. Non-inline version for using outside of the
lock module. */
ulint
lock_get_type(
/*==========*/
/* out: LOCK_TABLE or LOCK_REC */
const lock_t* lock); /* in: lock */
/*********************************************************************** /***********************************************************************
Gets the id of the transaction owning a lock. */ Gets the id of the transaction owning a lock. */
......
...@@ -67,8 +67,8 @@ struct lock_struct { ...@@ -67,8 +67,8 @@ struct lock_struct {
Gets the type of a lock. */ Gets the type of a lock. */
UNIV_INLINE UNIV_INLINE
ulint ulint
lock_get_type( lock_get_type_low(
/*==========*/ /*==============*/
/* out: LOCK_TABLE or LOCK_REC */ /* out: LOCK_TABLE or LOCK_REC */
const lock_t* lock); /* in: lock */ const lock_t* lock); /* in: lock */
......
...@@ -19,8 +19,8 @@ methods but they are used only in that file. */ ...@@ -19,8 +19,8 @@ methods but they are used only in that file. */
Gets the type of a lock. */ Gets the type of a lock. */
UNIV_INLINE UNIV_INLINE
ulint ulint
lock_get_type( lock_get_type_low(
/*==========*/ /*==============*/
/* out: LOCK_TABLE or LOCK_REC */ /* out: LOCK_TABLE or LOCK_REC */
const lock_t* lock) /* in: lock */ const lock_t* lock) /* in: lock */
{ {
......
...@@ -41,7 +41,7 @@ lock_queue_iterator_reset( ...@@ -41,7 +41,7 @@ lock_queue_iterator_reset(
iter->bit_no = bit_no; iter->bit_no = bit_no;
} else { } else {
switch (lock_get_type(lock)) { switch (lock_get_type_low(lock)) {
case LOCK_TABLE: case LOCK_TABLE:
iter->bit_no = ULINT_UNDEFINED; iter->bit_no = ULINT_UNDEFINED;
break; break;
...@@ -68,7 +68,7 @@ lock_queue_iterator_get_prev( ...@@ -68,7 +68,7 @@ lock_queue_iterator_get_prev(
{ {
const lock_t* prev_lock; const lock_t* prev_lock;
switch (lock_get_type(iter->current_lock)) { switch (lock_get_type_low(iter->current_lock)) {
case LOCK_REC: case LOCK_REC:
prev_lock = lock_rec_get_prev( prev_lock = lock_rec_get_prev(
iter->current_lock, iter->bit_no); iter->current_lock, iter->bit_no);
......
This diff is collapsed.
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