Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Mutex.h"
- void Mutex::acquire() {
- while (!lock.test_and_set()) {
- std::this_thread::yield();
- }
- }
- void Mutex::release() {
- lock.clear();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement