SyncObjs.TSpinWait.SpinCycle

From XE API Documentation
Jump to: navigation, search

Delphi

procedure SpinCycle;

C++

void __fastcall SpinCycle(void);

Properties

Type Visibility Source Unit Parent
procedure
function
public
SyncObjs.pas
SyncObjs.hpp
SyncObjs TSpinWait

Description

Keeps the thread in a busy waiting status.

Call SpinCycle to make the thread wait a number of CPU cycles before it tries to acquire the lock again. After 10 unsuccessful attempts, the thread sleeps for 1 millisecond every modulus 20 cycles, and sleeps for 0 milliseconds every modulus 5 cycles. All other cycles simply yield.

Code examples

See Also