uses our semaphore with busy waiting