Complex sentence: The calling process obtains the lock if the old value was 0; it "spins", writing 1 to the variable until this occurs.
Split into simpler sentences: The calling process obtains the lock if the old value was 0. It spins writing 1 to the variable until this occurs.