diff options
Diffstat (limited to 'storage/innobase/include/fil0fil.h')
-rw-r--r-- | storage/innobase/include/fil0fil.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index 70cbedc3a94..de98a2ed0ce 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -341,7 +341,7 @@ struct fil_space_t final friend fil_node_t; ~fil_space_t() { - ut_ad(!latch_owner); + ut_ad(latch_owner == std::thread::id()); ut_ad(!latch_count); latch.destroy(); } @@ -396,7 +396,7 @@ private: static constexpr uint32_t PENDING= ~(STOPPING | CLOSING | NEEDS_FSYNC); /** latch protecting all page allocation bitmap pages */ srw_lock latch; - os_thread_id_t latch_owner; + std::thread::id latch_owner; ut_d(Atomic_relaxed<uint32_t> latch_count;) public: UT_LIST_NODE_T(fil_space_t) named_spaces; @@ -995,21 +995,21 @@ public: #ifdef UNIV_DEBUG bool is_latched() const { return latch_count != 0; } #endif - bool is_owner() const { return latch_owner == os_thread_get_curr_id(); } + bool is_owner() const { return latch_owner == std::this_thread::get_id(); } /** Acquire the allocation latch in exclusive mode */ void x_lock() { latch.wr_lock(SRW_LOCK_CALL); - ut_ad(!latch_owner); - latch_owner= os_thread_get_curr_id(); + ut_ad(latch_owner == std::thread::id()); + latch_owner= std::this_thread::get_id(); ut_ad(!latch_count.fetch_add(1)); } /** Release the allocation latch from exclusive mode */ void x_unlock() { ut_ad(latch_count.fetch_sub(1) == 1); - ut_ad(latch_owner == os_thread_get_curr_id()); - latch_owner= 0; + ut_ad(latch_owner == std::this_thread::get_id()); + latch_owner= std::thread::id(); latch.wr_unlock(); } /** Acquire the allocation latch in shared mode */ @@ -1017,14 +1017,14 @@ public: { ut_ad(!is_owner()); latch.rd_lock(SRW_LOCK_CALL); - ut_ad(!latch_owner); + ut_ad(latch_owner == std::thread::id()); ut_d(latch_count.fetch_add(1)); } /** Release the allocation latch from shared mode */ void s_unlock() { ut_ad(latch_count.fetch_sub(1)); - ut_ad(!latch_owner); + ut_ad(latch_owner == std::thread::id()); latch.rd_unlock(); } |