Use spinlock instead of a semaphore