Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::vector<word> words;
- void routine_A() {
- lock = lockUnique(mtx);
- while (!words.empty) {
- cout << words[0];
- words.pop();
- cv.notify_one();
- cv.wait(lock);
- }
- }
- void routine_B() {
- lock = lockUnqiue(mtx);
- while (!words.empty) {
- cout << words[0];
- words.pop();
- cv.notify_one();
- cv.wait(lock);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement