Wake all of the threads waiting on a
std::condition_variable when the
current thread exits.
void notify_all_at_thread_exit( condition_variable& cv,unique_lock<mutex> lk);
true, and the lock
is owned by the calling thread.
lk.mutex() shall return the same value as
for any of the lock objects supplied to
cv from concurrently
Transfers ownership of the lock held by
into internal storage and schedules
to be notified when the calling thread exits. This notification
shall be as-if
std::system_error if the effects
cannot be achieved.
The lock is held until the thread exits, so care must be taken to avoid deadlock. It is recommended that the calling thread should exit as soon as possible, and that no blocking operations are performed on this thread.
The user should ensure that waiting threads do not erroneously
assume that the thread has exited when they are woken, particularly
with the potential for spurious wake-ups. This can be achieved
by testing a predicate on the waiting thread that is only made
true by the notifying thread under the protection of the mutex,
and without releasing the lock on the mutex prior to the call of