Changed strong semaphore to use pthread conditions