JCL Help:TJclDispatcherObject.WaitFor
JCL Help: TJclDispatcherObject.WaitFor Method
Search in JCL Help
Search in all projects
Summary
Blocks until the object becomes signaled or the timeout expires.
Pascal
public function WaitFor(const TimeOut: Cardinal): TJclWaitResult;
Parameters
Parameters | Description |
const TimeOut: Cardinal | Interval, in milliseconds, the method waits on an object. If the object does not become signaled before the interval has expired, the method returns. If you specify a 0 timeout the method tests the state of the object and immediately returns. You can specify INFINITE to wait forever or use WaitForever instead. |
Return Value
The result indicates success or failure and is of type TJclWaitResult. This type is shared between all WaitXxx functions and as such not all members of this enumeration can be returned from this method. Valid ones are wrError, wrAbandoned, wrTimeOut and wrSignaled. See TJclWaitResult for the details.
Description
WaitFor checks the state of the object, if it is non-signaled the calling thread enters a wait state until one of the following occurs:
- The object becomes signaled.
- The time-out interval expires.
If the object is signaled, or one of the above mentioned events occurs, the function returns and the thread is allowed to continue execution. Note that successfully waiting on a dispatcher object can, depending on the object, modify the state of the underlying object. For example, the count of a semaphore is decreased by one before the method returns. See the individual synchronization classes and the Platform SDK for details.
See Also
WaitAlertable WaitForever WaitForMultipleObjects WaitAlertableForMultipleObjects
About
Donator
Marcel van Brakel
Notes
This method results in non-alertable wait state while the object is not signaled. Use WaitAlertable to enter an alertable wait state.
Contribute to this help topic
This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page