Thread and Semaphores Exercise