#include <cpuyield.h>
Public Member Functions | |
CpuYield () | |
void | Reset () |
void | Pause (const void *res=nullptr) |
Static Public Member Functions | |
static void | Wait (Int cnt) |
Static Private Member Functions | |
static void | _mm_pause () |
Additional Inherited Members | |
![]() | |
using | SwitchDelegate = void(*)(CpuYieldState *state, const void *resource) |
![]() | |
Int | _count |
Int | _loopSize |
![]() | |
static const Int | LOOPS_START_COUNT |
static const Int | LOOPS_MAX_GRANULARITY |
static const Int | LOOPS_BEFORE_YIELD |
static const Int | LOOPS_BEFORE_SLEEP |
static const UInt | LOCK_ACQUIRE |
static const UInt | LOCK_SPIN |
static const UInt | LOCK_RELEASE |
static const UInt | MAX_STATE_ENUM |
CpuYield | ( | ) |
void Reset | ( | void | ) |
void Pause | ( | const void * | res = nullptr | ) |
Pauses a little while until the contended resource hopefully becomes available again. Depending on the number of calls this will either just do a light spin loop or it might put the thread to sleep. Furthermore offending threads might be logged to diagnose deadlocks or bad performance.
[in] | res | The contended resource because of which Pause has to be called. Might be a nullptr. |
|
static |
|
staticprivate |