Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void do_stuff_in_critical_section()
- {
- // ... some code BEFORE the critical section ...
- with_locks({ mutex1, mutex2 }, [&]
- {
- // ... some code INSIDE the critical section ...
- });
- // ... some code AFTER the critical section ...
- }
Add Comment
Please, Sign In to add comment