Started to fix prog5 (using pthreads) I'm using semaphores which are
exactaly what I need and I wish I had though to use them before.