The calling process obtains the lock if the old value was 0; it "spins", writing 1 to the variable until this occurs.
The calling process obtains the lock. The old value was 0. It "spins". It was writing 1 to the variable. This occurs.