Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class vector
- {
- float x_, y_;
- std::mutex guard_;
- };
- void foo(vector v1, vector v2)
- {
- std::lock_guard<std::mutex>(v1.guard_);
- std::lock_guard<std::mutex>(v2.guard_);
- // Do stuff with v1 and v2...
- }
Add Comment
Please, Sign In to add comment