This is relatively simple, but done in a bunch of commits to enable scripted diffs.
I wanted to add a semaphore in a branch I’ve been working on, but it was unclear if I should use std::counting_semaphore or stick with our old CSemaphore. I couldn’t decide, so I just decided to remove all doubt and get rid of ours :)
This replaces our old CSemaphore with std::counting_semaphore everywhere we used it. CSemaphoreGrant is still there as an RAII wrapper, but is now called CountingSemaphoreGrant and BinarySemaphoreGrant to match. Those have been moved out of sync.h to their own file.