From Appmethod Libraries
Jump to: navigation, search

Object Pascal

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


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


Type Visibility Source Unit Parent
function public
System.SyncObjs TLightweightEvent


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