tested spin lock based on semaphores