---
title: waitUntilAllOperationsAreFinished()
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/operationqueue/waituntilalloperationsarefinished()
---

# waitUntilAllOperationsAreFinished()

Blocks the current thread until all the receiver’s queued and executing operations finish executing.

## Declaration

```swift
func waitUntilAllOperationsAreFinished()
```

## Discussion

Discussion When called, this method blocks the current thread and waits for the receiver’s current and queued operations to finish executing. While the current thread is blocked, the receiver continues to launch already queued operations and monitor those that are executing. During this time, the current thread cannot add operations to the queue, but other threads may. Once all of the pending operations are finished, this method returns. If there are no operations in the queue, this method returns immediately.

## See Also

### Managing Operations in the Queue

- [addOperation(_:)](foundation/operationqueue/addoperation(_:)-64o8a.md)
- [addOperations(_:waitUntilFinished:)](foundation/operationqueue/addoperations(_:waituntilfinished:).md)
- [addOperation(_:)](foundation/operationqueue/addoperation(_:)-5s294.md)
- [addBarrierBlock(_:)](foundation/operationqueue/addbarrierblock(_:).md)
- [cancelAllOperations()](foundation/operationqueue/cancelalloperations().md)
- [operations](foundation/operationqueue/operations.md)
- [operationCount](foundation/operationqueue/operationcount.md)
