Basic example of semaphores on C