Guest User

Untitled

a guest
Oct 21st, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. class vector
  2. {
  3. float x_, y_;
  4. std::mutex guard_;
  5. };
  6.  
  7. void foo(vector v1, vector v2)
  8. {
  9. std::lock_guard<std::mutex>(v1.guard_);
  10. std::lock_guard<std::mutex>(v2.guard_);
  11. // Do stuff with v1 and v2...
  12. }
Add Comment
Please, Sign In to add comment