working semaphores