StopWait procedure
Return to Introduction  Previous page  Next page
Unit
acUtils  

Declaration
procedure StopWait(var WaitHandle: THandle);  

Description
The StopWait procedure used to send a signal to WaitHandle, so the program will continue its execution from next line after the call of Wait procedure.  
 
tip The Wait and StopWait routines should be used instead "while something do Application.ProcessMessages;", to not utilize CPU time for long time, until some operation will be completed.  

Original code
procedure StopWait(var WaitHandle: THandle);  
begin  
  if (WaitHandle <> INVALID_HANDLE_VALUE) and (WaitHandle <> 0then  
    SetEvent(WaitHandle);  
end;  

See also
Wait procedure.