Commit 6eb200a4 authored by marko's avatar marko

Enclose rw_lock_validate() in #ifdef UNIV_DEBUG. It is only called by

debug assertions.
parent 20d53145
...@@ -101,6 +101,7 @@ void ...@@ -101,6 +101,7 @@ void
rw_lock_free( rw_lock_free(
/*=========*/ /*=========*/
rw_lock_t* lock); /* in: rw-lock */ rw_lock_t* lock); /* in: rw-lock */
#ifdef UNIV_DEBUG
/********************************************************************** /**********************************************************************
Checks that the rw-lock has been initialized and that there are no Checks that the rw-lock has been initialized and that there are no
simultaneous shared and exclusive locks. */ simultaneous shared and exclusive locks. */
...@@ -109,6 +110,7 @@ ibool ...@@ -109,6 +110,7 @@ ibool
rw_lock_validate( rw_lock_validate(
/*=============*/ /*=============*/
rw_lock_t* lock); rw_lock_t* lock);
#endif /* UNIV_DEBUG */
/****************************************************************** /******************************************************************
NOTE! The following macros should be used in rw s-locking, not the NOTE! The following macros should be used in rw s-locking, not the
corresponding function. */ corresponding function. */
......
...@@ -174,9 +174,7 @@ rw_lock_free( ...@@ -174,9 +174,7 @@ rw_lock_free(
/*=========*/ /*=========*/
rw_lock_t* lock) /* in: rw-lock */ rw_lock_t* lock) /* in: rw-lock */
{ {
#ifdef UNIV_DEBUG ut_ad(rw_lock_validate(lock));
ut_a(rw_lock_validate(lock));
#endif /* UNIV_DEBUG */
ut_a(rw_lock_get_writer(lock) == RW_LOCK_NOT_LOCKED); ut_a(rw_lock_get_writer(lock) == RW_LOCK_NOT_LOCKED);
ut_a(rw_lock_get_waiters(lock) == 0); ut_a(rw_lock_get_waiters(lock) == 0);
ut_a(rw_lock_get_reader_count(lock) == 0); ut_a(rw_lock_get_reader_count(lock) == 0);
...@@ -199,6 +197,7 @@ rw_lock_free( ...@@ -199,6 +197,7 @@ rw_lock_free(
mutex_exit(&rw_lock_list_mutex); mutex_exit(&rw_lock_list_mutex);
} }
#ifdef UNIV_DEBUG
/********************************************************************** /**********************************************************************
Checks that the rw-lock has been initialized and that there are no Checks that the rw-lock has been initialized and that there are no
simultaneous shared and exclusive locks. */ simultaneous shared and exclusive locks. */
...@@ -226,6 +225,7 @@ rw_lock_validate( ...@@ -226,6 +225,7 @@ rw_lock_validate(
return(TRUE); return(TRUE);
} }
#endif /* UNIV_DEBUG */
/********************************************************************** /**********************************************************************
Lock an rw-lock in shared mode for the current thread. If the rw-lock is Lock an rw-lock in shared mode for the current thread. If the rw-lock is
......
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