Tried to replace semaphore