System.SyncObjs.TLightweightEvent.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 TLightweightEvent

Description

Blocks the current thread until the event is signaled or timeout expires.

If the event is in non-signaled state, then WaitFor does not immediately block the calling thread. It spends a number of CPU cycles in spin loop and then, if the event is still in non-signaled state, it blocks the calling thread.

If after Timeout milliseconds the event is still in non-signaled state, WaitFor returns anyway.

WaitFor returns the wait result. It can be wrSignaled or wrTimeout.

Code Examples

See Also