System.SyncObjs.TLightweightSemaphore.WaitFor

From RAD Studio API Documentation
Jump to: navigation, search

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

Properties

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

Description

Blocks the calling thread until the TLightweightSemaphore is in signaled state or until the specified timeout is over.

However, the blocking does not occur immediately. WaitFor first spends a few CPU cycles in a spin-loop and then blocks the thread if the semaphore is still not in the signaled state.

WaitFor returns a TWaitResult.


See Also