A condition variable is an inter-thread synchronisation mechanism that allows a thread to sleep while waiting for another thread to perform some work.
See std condition_variable - cppreference.com.
Atomics & Condition Variable should be mixed carefully