scoped-lock Questions

3

Solved

Context: I know that std::lock_guard became kind of deprecated since the arrival of c++17 with std::scoped_lock. I also know that std::scoped_lock is preferred since it can handle several mutexes...
Pyelitis asked 29/1, 2020 at 12:11

2

Solved

C++17 introduced both std::shared_mutex and std::scoped_lock. My problem is now, that it seems, that scoped_lock will lock a shared mutex always in exclusive (writer) mode, when it is passed as an ...
Piecedyed asked 12/2, 2019 at 0:42

2

Solved

I was reading through a Boost Mutex tutorial on drdobbs.com, and found this piece of code: #include <boost/thread/thread.hpp> #include <boost/thread/mutex.hpp> #include <boost/bind....
Deflect asked 2/6, 2013 at 12:34

3

Solved

My shortened, simplified class looks as follows: class A { public: // ... methodA(); methodB(); protected: mutable boost::mutex m_mutex; sometype* m_myVar; } A::methodA( int someParam ) {...
Minatory asked 23/10, 2011 at 9:47

3

Solved

I'm looking for code shortening idea. I'm using boost::scoped_lock to lock a boost::mutex but I want to shorten the amount of code I'm writing. Currently I have a mutex defined in my class and the...
Brancusi asked 20/7, 2011 at 21:44

1

Solved

I'm using boost::interprocess::scoped_lock, if the application crash for some reason inside the scope the mutex isn't released. Next time the application is executed (without restarting the compute...
Awaken asked 7/6, 2011 at 15:50
1

© 2022 - 2024 — McMap. All rights reserved.