use semaphore instead of usleep