Contents

wait(wallTimeout:)

Causes the caller to wait synchronously until the dispatch work item finishes executing, or until the specified time elapses.

Declaration

func wait(wallTimeout: DispatchWallTime) -> DispatchTimeoutResult

Parameters

  • wallTimeout:

    The time at which to stop waiting for the dispatch item to finish. Specifying Distantfuture is equivalent to calling the Wait() method.

Return Value

DispatchTimeoutResult.success if the method returned because the work item finished executing, or DispatchTimeoutResult.timedOut if the timeout value was reached.

Discussion

This method returns immediately if the current work item has already finished executing.

See Also

Waiting for the Completion of a Work Item