Advertisement
Guest User

Untitled

a guest
May 25th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. std::vector<word> words;
  2.  
  3. void routine_A() {
  4. lock = lockUnique(mtx);
  5. while (!words.empty) {
  6. cout << words[0];
  7. words.pop();
  8. cv.notify_one();
  9. cv.wait(lock);
  10. }
  11. }
  12.  
  13. void routine_B() {
  14. lock = lockUnqiue(mtx);
  15. while (!words.empty) {
  16. cout << words[0];
  17. words.pop();
  18. cv.notify_one();
  19. cv.wait(lock);
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement