sample code for semaphore test