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

Method Sleep

util/system/spin_wait.cpp:30–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30void TSpinWait::Sleep() noexcept {
31 ++C;
32
33 if (C == MAX_SPIN_COUNT) {
34 ThreadYield();
35 } else if ((C & MAX_SPIN_COUNT) == 0) {
36 usleep(RandomizeSleepTime(T));
37
38 T = Min<unsigned>(T * 3 / 2, 20000);
39 } else {
40 SpinLockPause();
41 }
42}

Callers 3

LockRecursiveMethod · 0.45
AcquireMethod · 0.45

Calls 4

ThreadYieldFunction · 0.85
usleepFunction · 0.85
RandomizeSleepTimeFunction · 0.85
SpinLockPauseFunction · 0.85

Tested by

no test coverage detected