MCPcopy Create free account
hub / github.com/catboost/catboost / Acquire

Method Acquire

util/system/spinlock.h:69–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67 using TSpinLockBase::TSpinLockBase;
68
69 inline void Acquire() noexcept {
70 intptr_t zero = 0;
71 if (Val_.compare_exchange_strong(zero, 1)) {
72 return;
73 }
74 do {
75 SpinLockPause();
76 zero = 0;
77 } while (Val_.load(std::memory_order_acquire) != 0 ||
78 !Val_.compare_exchange_strong(zero, 1));
79 }
80
81 inline void lock() noexcept {
82 Acquire();

Callers

nothing calls this directly

Calls 3

SpinLockPauseFunction · 0.85
loadMethod · 0.45

Tested by

no test coverage detected