Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- template<typename _Lock>
- void
- wait(_Lock& __lock)
- {
- shared_ptr<mutex> __mutex = _M_mutex; // <-- Extend lifetime of mutex.
- unique_lock<mutex> __my_lock(*__mutex);
- _Unlock<_Lock> __unlock(__lock);
- // *__mutex must be unlocked before re-locking __lock so move
- // ownership of *__mutex lock to an object with shorter lifetime.
- unique_lock<mutex> __my_lock2(std::move(__my_lock));
- _M_cond.wait(__my_lock2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement