Ported semaphore implementation to the time units abstraction layer.