# std::latch::wait

> C++ Atlas: `cppatlas.com/w/cpp/thread/latch/wait` | Source: https://en.cppreference.com/w/cpp/thread/latch/wait | Domain: Concurrency support | Standards: C++20

Blocks the calling thread until the internal counter reaches 0 . If it is zero already, returns immediately.

## Official Specification Summary (cppreference)

```cpp
void wait() const; // (since C++20)
```

Blocks the calling thread until the internal counter reaches `​0​`. If it is zero already, returns immediately.

### Parameters

(none)

### Return value

(none)

### Exceptions

Throws `std::system_error` with an error code allowed for mutex types on error.

---
Attribution: content from https://en.cppreference.com/w/cpp/thread/latch/wait (cppreference.com), licensed under CC-BY-SA 3.0 and GFDL. Modified: converted to markdown, study notes added. Offline snapshot of 9 February 2025.