Replace spin-lock instead of semaphore.