Add a semaphore implementation