Difference between revisions of "cpp/thread/condition variable/~condition variable"
From cppreference.com
< cpp | thread | condition variable
m (r2.7.3) (Robot: Adding de, es, fr, it, ja, pt, ru, zh) |
m (Shorten template names. Use {{lc}} where appropriate.) |
||
Line 1: | Line 1: | ||
− | {{page | + | {{page|cpp/thread/condition_variable/destructor|condition_variable}} |
[[de:cpp/thread/condition variable/~condition variable]] | [[de:cpp/thread/condition variable/~condition variable]] |
Revision as of 20:59, 31 May 2013
~condition_variable(); |
(since C++11) | |
Destroys the object of type std::condition_variable.
Notes
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.
See also
C documentation for cnd_destroy
|