---
title: "sync(execute:)"
framework: dispatch
role: symbol
role_heading: Instance Method
path: "dispatch/dispatchqueue/sync(execute:)-2fzvo"
---

# sync(execute:)

Submits a work item for execution on the current queue and returns after that block finishes executing.

## Declaration

```swift
func sync(execute workItem: DispatchWorkItem)
```

## Parameters

- `workItem`: The dispatch work item containing the task to execute. For information on how to create this work item, see doc://com.apple.dispatch/documentation/Dispatch/DispatchWorkItem.

## See Also

### Executing Tasks Synchronously

- [sync(execute:)](dispatch/dispatchqueue/sync(execute:)-3segw.md)
- [sync(execute:)](dispatch/dispatchqueue/sync(execute:)-20xby.md)
- [sync(flags:execute:)](dispatch/dispatchqueue/sync(flags:execute:).md)
- [asyncAndWait(execute:)](dispatch/dispatchqueue/asyncandwait(execute:)-1udeu.md)
