Talk:cpp/thread/lock tag t

I believe the alternative approach documented in the example, where you init std::lock_guard<> with a second ctor arg of std::defer_lock, is wrong. std::lock_guard's ctor only takes std::adopt_lock. If you want defer_lock, you have to do this instead:

std::unique_lock lock(my_mutex, std::defer_lock);

199.19.248.82 21:58, 3 September 2015 (PDT)Daniel Hardman
 * Fixed. Thanks! T. Canens (talk) 23:09, 3 September 2015 (PDT)