semaphore bug