On windows.
that would be WindowsCriticalSection.h for
FCriticalSection::Lock()
and
FPlatformProcess::Semaphore()
If you are looking for the definitions of other platforms, try doing a ctrl+shift+f search in visual studio, targeting the whole solution. If you have ue4’s source available for searching it will show up in no time.
Don’t give up just yet. Check out their async implementation. They have most everything single threaded platforms should need. Async | Unreal Engine Documentation.
Also I glanced over a single threaded implementation of FRunnable in the engine source at one point. Basically just keep looking, I am sure what you want is there.
Thanks! I ended up just creating a queue and storing requests to the critical section and then a service is run as a one shot timer every second or so. That service will pull one thing off the queue and grant it entry to the critical section and then when its finished the critical section re-invokes the service and so on until the queue is empty at which time the service reschedules itself.