System.SyncObjs.TLightweightSemaphore.WaitFor

De RAD Studio API Documentation
Aller à : navigation, rechercher

Delphi

function WaitFor(Timeout: Cardinal = INFINITE): TWaitResult; overload; override;

C++

virtual System::Types::TWaitResult __fastcall WaitFor(unsigned Timeout = (unsigned)(0xffffffff))/* overload */;
inline System::Types::TWaitResult __fastcall  WaitFor(const System::Timespan::TTimeSpan &Timeout){ return TSynchroObject::WaitFor(Timeout); }

Propriétés

Type Visibilité  Source Unité  Parent
function public
System.SyncObjs.pas
System.SyncObjs.hpp
System.SyncObjs TLightweightSemaphore

Description

Bloque le thread appelant jusqu'à ce que TLightweightSemaphore soit en état signalé ou jusqu'à ce que le délai soit terminé.

Cependant, le blocage ne survient pas immédiatement. WaitFor dépense d'abord quelques cycles CPU dans un verrou d'incrémenteur, puis bloque le thread si le sémaphore n'est pas encore en état signalé.

WaitFor renvoie un TWaitResult.


Voir aussi