MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / IsLockedByCurrentCore

Method IsLockedByCurrentCore

src/include/spinlock.hpp:115–119  ·  view source on GitHub ↗

* @brief 检查当前 core 是否获得此锁 * @return true 是 * @return false 否 */

Source from the content-addressed store, hash-verified

113 * @return false 否
114 */
115 __always_inline auto IsLockedByCurrentCore() -> bool {
116 return locked_.test(std::memory_order_acquire) &&
117 (core_id_.load(std::memory_order_acquire) ==
118 cpu_io::GetCurrentCoreId());
119 }
120};
121
122/**

Callers 3

test_basic_lockFunction · 0.80
test_lock_guardFunction · 0.80
TEST_FFunction · 0.80

Calls 1

GetCurrentCoreIdFunction · 0.85

Tested by 3

test_basic_lockFunction · 0.64
test_lock_guardFunction · 0.64
TEST_FFunction · 0.64