diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2019-11-24 18:19:33 +0100 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2019-11-24 18:19:33 +0100 |
commit | ce49812ec5465539c2bf84fcdfddedc9d1cd52a0 (patch) | |
tree | dcfdf62ca00c5b2f35ddbd2a0243b1639305f0ee /storage/innobase/include/btr0sea.ic | |
parent | afc21ab6d8e785299e0d9e5339b8c94a90b3355c (diff) | |
parent | a14544260c33dcdb057d2f62c4aab33cb09ebcb1 (diff) | |
download | mariadb-git-ce49812ec5465539c2bf84fcdfddedc9d1cd52a0.tar.gz |
Commit conflict resolving after pulling from origin 10.3
Diffstat (limited to 'storage/innobase/include/btr0sea.ic')
-rw-r--r-- | storage/innobase/include/btr0sea.ic | 55 |
1 files changed, 25 insertions, 30 deletions
diff --git a/storage/innobase/include/btr0sea.ic b/storage/innobase/include/btr0sea.ic index fba97835395..17bc7e555bd 100644 --- a/storage/innobase/include/btr0sea.ic +++ b/storage/innobase/include/btr0sea.ic @@ -13,7 +13,7 @@ FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA +51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA *****************************************************************************/ @@ -31,9 +31,7 @@ Created 2/17/1996 Heikki Tuuri /** Create and initialize search info. @param[in,out] heap heap where created @return own: search info struct */ -UNIV_INLINE -btr_search_t* -btr_search_info_create(mem_heap_t* heap) +static inline btr_search_t* btr_search_info_create(mem_heap_t* heap) { btr_search_t* info = static_cast<btr_search_t*>( mem_heap_zalloc(heap, sizeof(btr_search_t))); @@ -54,7 +52,7 @@ btr_search_info_update_slow(btr_search_t* info, btr_cur_t* cursor); /*********************************************************************//** Updates the search info. */ -UNIV_INLINE +static inline void btr_search_info_update( /*===================*/ @@ -87,9 +85,7 @@ btr_search_info_update( } /** Lock all search latches in exclusive mode. */ -UNIV_INLINE -void -btr_search_x_lock_all() +static inline void btr_search_x_lock_all() { for (ulint i = 0; i < btr_ahi_parts; ++i) { rw_lock_x_lock(btr_search_latches[i]); @@ -97,9 +93,7 @@ btr_search_x_lock_all() } /** Unlock all search latches from exclusive mode. */ -UNIV_INLINE -void -btr_search_x_unlock_all() +static inline void btr_search_x_unlock_all() { for (ulint i = 0; i < btr_ahi_parts; ++i) { rw_lock_x_unlock(btr_search_latches[i]); @@ -107,9 +101,7 @@ btr_search_x_unlock_all() } /** Lock all search latches in shared mode. */ -UNIV_INLINE -void -btr_search_s_lock_all() +static inline void btr_search_s_lock_all() { for (ulint i = 0; i < btr_ahi_parts; ++i) { rw_lock_s_lock(btr_search_latches[i]); @@ -117,9 +109,7 @@ btr_search_s_lock_all() } /** Unlock all search latches from shared mode. */ -UNIV_INLINE -void -btr_search_s_unlock_all() +static inline void btr_search_s_unlock_all() { for (ulint i = 0; i < btr_ahi_parts; ++i) { rw_lock_s_unlock(btr_search_latches[i]); @@ -131,9 +121,7 @@ btr_search_s_unlock_all() @param[in] mode lock mode check @retval true if owns all of them @retval false if does not own some of them */ -UNIV_INLINE -bool -btr_search_own_all(ulint mode) +static inline bool btr_search_own_all(ulint mode) { for (ulint i = 0; i < btr_ahi_parts; ++i) { if (!rw_lock_own(btr_search_latches[i], mode)) { @@ -147,9 +135,7 @@ btr_search_own_all(ulint mode) @param[in] mode lock mode check @retval true if owns any of them @retval false if owns no search latch */ -UNIV_INLINE -bool -btr_search_own_any(ulint mode) +static inline bool btr_search_own_any(ulint mode) { for (ulint i = 0; i < btr_ahi_parts; ++i) { if (rw_lock_own(btr_search_latches[i], mode)) { @@ -158,17 +144,28 @@ btr_search_own_any(ulint mode) } return(false); } + +/** @return whether this thread holds any of the search latches */ +static inline bool btr_search_own_any() +{ + for (ulint i = btr_ahi_parts; i--; ) { + if (rw_lock_own_flagged(btr_search_latches[i], + RW_LOCK_FLAG_X | RW_LOCK_FLAG_S)) { + return true; + } + } + return false; +} #endif /* UNIV_DEBUG */ /** Get the adaptive hash search index latch for a b-tree. @param[in] index b-tree index @return latch */ -UNIV_INLINE -rw_lock_t* -btr_get_search_latch(const dict_index_t* index) +static inline rw_lock_t* btr_get_search_latch(const dict_index_t* index) { ut_ad(index != NULL); - ut_ad(index->table->space->id == index->table->space_id); + ut_ad(!index->table->space + || index->table->space->id == index->table->space_id); ulint ifold = ut_fold_ulint_pair(ulint(index->id), index->table->space_id); @@ -180,9 +177,7 @@ btr_get_search_latch(const dict_index_t* index) A table is selected from an array of tables using pair of index-id, space-id. @param[in] index index handler @return hash table */ -UNIV_INLINE -hash_table_t* -btr_get_search_table(const dict_index_t* index) +static inline hash_table_t* btr_get_search_table(const dict_index_t* index) { ut_ad(index != NULL); ut_ad(index->table->space->id == index->table->space_id); |