Skip to content

Glossary: C++ Beyond the Basics

Condition variable

Also written: condition variables, std::condition_variable, notify_one, notify_all

A `std::condition_variable` lets a thread sleep until another thread says something changed. The waiter calls `wait(lock, predicate)` and the other thread calls `notify_one()` or `notify_all()`.

Where the book teaches it

Related terms

MutexSpurious wake-upLock guardstd::unique_lock