Bringing back semaphore code.