##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::condition_variable_any::~condition_variable_any

From cppreference.com
< cpp‎ | thread‎ | condition variable any

[edit template]

~condition_variable_any(); | (1) | (since C++11)

Destroys the object of type std::condition_variable_any

It is only safe to invoke the destructor if all threads have been notified. It is not required that they have exited their respective wait functions: some threads may still be waiting to reacquire the associated lock, or may be waiting to be scheduled to run after reacquiring it.

The programmer must ensure that no threads attempt to wait on *this once the destructor has been started, especially when the waiting threads are calling the wait functions in a loop or are using the overloads of the wait functions that take a predicate.

### [edit] Exceptions

(none)

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/thread/condition_variable_any/%7Econdition_variable_any&oldid=51351"