Wait for the Operation to complete.
This blocks the caller until the operation completes (including by timeout or cancel), or the timeout of this wait expires, whichever occurs first. During this wait, information continues to be passed to the callbacks as necessary. If the Operation completes or times out during this call, the callback is called for the last time prior to this call returning, and the return value will be TRUE. If this call's timeout expires first, then the return value will be FALSE.
The time specified in this call does not affect the Operation itself; it only specifies the maximum time this call will pend waiting for the operation to be complete. Avoid using the same timeout as the operation, since this can introduce a race condition (the operation may or may not actually complete before this wait does). Instead, use DOF_TIMEOUT_NEVER
. The maximum time this call can wait is the minimum of the operation's time remaining and timeout.
It is not safe to use this call if the operation's complete callback can result in a call to DOFOperation_Destroy (refer to that function's documentation for more information).
- Note
- If this call returns TRUE, it is guaranteed that all callbacks associated with the operation have been called and have returned.
- Parameters
-
| op | The Operation. This must not be NULL. |
| timeout | The maximum time to wait, in milliseconds. |
[out] | pException | An Exception. If pException is NULL , no exception is reported. Otherwise, the output is either a DOFException, or NULL to indicate no exception occurred. DOFException_Destroy must be called to destroy the returned DOFException, if any. |
- Return values
-
TRUE | if the operation has completed. If pException is not NULL, it will contain the same exception (if any) given to the operation's Complete callback. |
FALSE | if the operation has not completed within the specified time, or an error occurred. If pException is not NULL, it will be set as follows:
- A DOFErrorException containing DOFERROR_TIMEOUT if the operation is still in progress (the wait timed out).
- A DOFErrorException containing DOFERROR_INSUFFICIENT_RESOURCES if internal resources could not be created to process this request.
|
- See Also
- DOFOperation_IsComplete