STLdoc
STLdocumentation
|
Implements busy wait with no backoff More...
#include <concrt.h>
Public Types | |
typedef void(__cdecl * | _YieldFunction) () |
Public Member Functions | |
_SpinWait (_YieldFunction _YieldMethod=_UnderlyingYield) | |
Construct a spin wait object More... | |
void | _SetSpinCount (unsigned int _Count) |
Set a dynamic spin count. More... | |
bool | _SpinOnce () |
Spins for one time quantum,until a maximum spin is reached. More... | |
Protected Types | |
enum | _SpinState { _StateInitial, _StateSpin, _StateYield, _StateBlock, _StateSingle } |
State of the spin wait class. More... | |
Protected Member Functions | |
void | _DoYield () |
Yields its time slice using the specified yieldFunction More... | |
void | _Reset () |
Resets the counts and state to the default. More... | |
unsigned long | _NumberOfSpins () |
Determines the current spin count More... | |
bool | _ShouldSpinAgain () |
Determines whether maximum spin has been reached More... | |
Protected Attributes | |
unsigned long | _M_currentSpin |
unsigned long | _M_currentYield |
_SpinState | _M_state |
_YieldFunction | _M_yieldFunction |
Implements busy wait with no backoff
typedef void(__cdecl * Concurrency::details::_SpinWait< _YieldCount >::_YieldFunction) () |
|
protected |
|
inline |
Construct a spin wait object
|
inlineprotected |
Yields its time slice using the specified yieldFunction
|
inlineprotected |
|
inlineprotected |
Resets the counts and state to the default.
|
inline |
Set a dynamic spin count.
|
inlineprotected |
Determines whether maximum spin has been reached
|
inline |
Spins for one time quantum,until a maximum spin is reached.
If the spin count is not changing do not spin again because there is either only one processor, or the maximum spin has been reached and blocking is probably a better solution. However, if called again, SpinOnce will spin for a maximum spin count.
|
protected |
|
protected |
|
protected |
|
protected |