Method Signal():wait() Foundation

Waits for the signal to be posted with optional timeout.

Syntax
:wait( [<nHSecs>], [<lReset>] ) --> lSignaled
Parameters
<nHSecs>
Optional timeout in hundredths of seconds. A value of 0 or if the parameter is omitted means wait indefinitely.
<lReset>
Optional logical value. The default value of .T. (true) resets the signal after successful wait, .F. (false) leaves it signaled.
Return

.T. (true) if signal was received, .F. (false) if a timeout occurred.

Description

The :wait() method blocks the calling thread until the Signal object is signaled by another thread calling the :signal() method, or until the specified timeout expires.

This method implements the consumer side of the signal/wait pattern. The calling thread suspends its execution and enters a waiting state. When the signal is posted, the thread is awakened and continues execution.

By default, the signal is automatically reset after a successful wait, ensuring that subsequent calls to :wait() will block until the signal is posted again. This behavior can be controlled with the <lReset> parameter.

If a timeout is specified and expires before the signal is posted, the method returns .F. (false) and the thread continues execution.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.