The Little Book of Semaphores exercise