test for semaphore