System.SyncObjs.TSpinWait

De RAD Studio API Documentation
Aller à : navigation, rechercher

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};
};

Propriétés

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

Description

Une instance de TSpinWait permet au thread en cours d'attendre pendant un certain nombre de cycles d'incrémentation.

L'enregistrement TSpinWait peut être utilisé pour provoquer l'état d'attente d'un thread pendant un certain nombre de cycles d'incrémentation. A l'opposé de la méthode TThread.Sleep, pour le thread en cours, TSpinWait ne renoncera pas au reste de sa tranche de temps processeur en cours.

Voir aussi

Exemples de code