The acquire and release are related not to this atomic variable, but to the rest of variables read/written in each one of the threads.
To make it more obvious, without the release in unlock()
and the acquire in the lock()
the flag would still be visible. The problem is that a write to a variable protected by the spin lock may be pushed after the lock is released, introducing a race condition. In the same way a read of that variable inside the lock might be moved to before the lock()