---
title: wait()
framework: dispatch
role: symbol
role_heading: Instance Method
path: dispatch/dispatchsemaphore/wait()
---

# wait()

Waits for, or decrements, a semaphore.

## Declaration

```swift
func wait()
```

## Discussion

Discussion Decrement the counting semaphore. If the resulting value is less than zero, this function waits for a signal to occur before returning.

## See Also

### Blocking on the Semaphore

- [wait(timeout:)](dispatch/dispatchsemaphore/wait(timeout:).md)
- [wait(wallTimeout:)](dispatch/dispatchsemaphore/wait(walltimeout:).md)
