Effects: Transfers ownership of the lock associated with lk into
internal storage and schedules cond to be notified when the current
thread exits, after all objects of thread storage duration associated with
the current thread have been destroyed.
This notification is equivalent to:
lk.unlock();
cond.notify_all();
Synchronization: The implied lk.unlock() call is sequenced after the destruction of
all objects with thread storage duration associated with the current thread.
It is the user's responsibility to ensure that waiting threads
do not erroneously assume that the thread has finished if they experience
spurious wakeups.
This typically requires that the condition being waited
for is satisfied while holding the lock on lk, and that this lock
is not released and reacquired prior to calling notify_all_at_thread_exit.