semaphore with busy waiting and spin lock