From d1edb011eead8401bf14c8d1e90a6fb3f2a4d6e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 19 Apr 2022 13:49:52 +0300 Subject: Cleanup: Remove os0thread Let us use the common pthread_t wrapper for Microsoft Windows. This fixes up commit dbe941e06fe51fe0ff30dff5f1ae62960ff4fc61 --- storage/innobase/include/fil0fil.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'storage/innobase/include/fil0fil.h') diff --git a/storage/innobase/include/fil0fil.h b/storage/innobase/include/fil0fil.h index 2041b857a48..9df3a260152 100644 --- a/storage/innobase/include/fil0fil.h +++ b/storage/innobase/include/fil0fil.h @@ -412,7 +412,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; + pthread_t latch_owner; ut_d(Atomic_relaxed latch_count;) public: /** MariaDB encryption data */ @@ -1040,20 +1040,20 @@ 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 == pthread_self(); } /** 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(); + latch_owner= pthread_self(); 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()); + ut_ad(latch_owner == pthread_self()); latch_owner= 0; latch.wr_unlock(); } -- cgit v1.2.1