Paused

while (lock.exchange(true)) {
  pause();
}
lock.store(false);
^ This is Faster?
while (lock.exchange(true)) {
}
lock.store(false);
^ This is Faster?

* The benchmark is run under AMD Ryzen 9.

* For the full benchmark code, please refer here.

* For illustration purposes only, see FAQ for more details.