Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Class {
- public:
- void method0() {
- std::unique_lock<std::mutex>(m_mutex);
- // Do something
- }
- void method1() {
- std::unique_lock<std::mutex>{m_mutex};
- // Do something
- }
- private:
- std::mutex m_mutex;
- };
- // Thread 0:
- while(true) cls.method0();
- // Thread 1:
- while(true) cls.method1();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement