TROEvent

Overview

TROEvent represents an external user-defined event.

TROEvent is used to signal that a user-defined event has occurred or a state has been reached.

Location

Instance Methods


constructor Create

Creates a new user-defined external event for the Windows platform constructor. For non Windows platform constructors, it calls the function sem_init to initialize the unnamed semaphore referred to by the private variable FEvent.

constructor Create(Dummy: Pointer; ManualReset: Boolean; InitialVal: Boolean; Name: string)

Parameters:

  • Dummy:
  • ManualReset:
  • InitialVal: Represents the initial value for the FEvent.
  • Name:

ResetEvent

Clears the waitable event handler for Windows platform procedure. This procedure is used to ensure that signals posted to the waitable event handle in the class instance are cleared.

procedure ResetEvent

SetEvent

Sets the signal for the event. SetEvent is used to ensure that the event handle is signaled in the class instance. For non Windows platforms, SetEvent calls the function to get the value of the FEvent. If FEvent is locked, it calls the function sem_post to unlock the semaphore FEvent.

procedure SetEvent

WaitFor

Blocks the current thread until the current event receives a signal. The procedure WaitFor is used only in non-Windows platforms.

function WaitFor(Timeout: Cardinal): TWaitResult

Parameters:

  • Timeout: Indicates the time (in milliseconds) to wait for the signal on the waitable event handle. If Timeout has the value INFINITE, the procedure WaitFor blocks the current thread until the current event receives a signal without considering the Timeout.