3 ms·
Probably atomic increment / decrement + condition_variable. Just check if you hit 0 on decrement to notify waiters (or return if you are the waiter).
by searealist 6y ago
Probably atomic increment / decrement + condition_variable. Just check if you hit 0 on decrement to notify waiters (or return if you are the waiter).
- ridiculous_fish 6y agoWell now that sounds like a semaphore!