fix semaphore init value bug