System.SyncObjs.TSpinWait

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

TSpinWait = record

C++

struct DECLSPEC_DRECORD TSpinWait
{
private:
    static const System::Int8 YieldThreshold = System::Int8(0xa);
    static const System::Int8 Sleep1Threshold = System::Int8(0x14);
    static const System::Int8 Sleep0Threshold = System::Int8(0x5);
    int FCount;
    bool __fastcall GetNextSpinCycleWillYield();
public:
    void __fastcall Reset();
    void __fastcall SpinCycle();
    static void __fastcall SpinUntil(const System::DelphiInterface<System::Sysutils::TFunc__1<bool> > ACondition)/* overload */;
    static bool __fastcall SpinUntil(const System::DelphiInterface<System::Sysutils::TFunc__1<bool> > ACondition, unsigned Timeout)/* overload */;
    static bool __fastcall SpinUntil(const System::DelphiInterface<System::Sysutils::TFunc__1<bool> > ACondition, const System::Timespan::TTimeSpan &Timeout)/* overload */;
    __property int Count = {read=FCount};
    __property bool NextSpinCycleWillYield = {read=GetNextSpinCycleWillYield};
};

Properties

Type Visibility Source Unit Parent
record
struct
public
System.SyncObjs.pas
System.SyncObjs.hpp
System.SyncObjs System.SyncObjs

Description

An instance of TSpinWait allows the current thread to wait for a number of spin cycles.

The TSpinWait record can be used to cause a thread to wait for a number of spin cycles. As opposed to the TThread.Sleep method, for the current thread, TSpinWait will not yield the rest of its current slice of processor time.

See Also

Code Examples