A simple Lock using semaphores