Top "Stdmutex" questions

std::unique_lock<std::mutex> or std::lock_guard<std::mutex>?

I have two use cases. A. I want to synchronise access to a queue for two threads. B. I want …

c++ multithreading c++11 mutual-exclusion stdmutex
Using std::mutex as member variable in a class

I have defined a class that has std::mutex my_mutex as its private member variable. But when I try …

c++11 mutex stdmutex