Defined in header
condition_variable_any class is a generalization of std::condition_variable. Whereas std::condition_variable works only on std::unique_lock<std::mutex>,
condition_variable_any can operate on any user-defined lock that meets the
condition_variable_any provides similar functionality to std::condition_variable. It is a synchronization primitive that can be used to block some number of threads until:
- a notification is received from another thread
- a timeout expires, or
- a spurious wakeup occurs
Any thread that intends to wait on
std::condition_variable_any has to acquire a lock first. The wait operations atomically release the lock and suspend the execution of the thread. When the condition variable is notified, the thread is awakened, and the lock is reacquired.
std::condition_variable_any is a standard-layout class. It is not copy-constructible, move-constructible, copy-assignable, or move-assignable.