Skip to content
Commit 927efd0b authored by Dmitry Vyukov's avatar Dmitry Vyukov
Browse files

sanitizer_common: modernize SpinMutex

Some minor improvements:
1. Make StaticSpinMutex non-copyable.
2. Add LIKELY to Lock.
3. Move LockSlow into the .cpp file (now that we have it).
4. The only non-trivial change: use proc_yield(1) instread of proc_yield(10)
   with the proportional increase in the number of spin iterations.
   Latency of the PAUSE instruction has raised from ~1 cycle to ~100 cycles
   in the recent Intel CPUs. So proc_yield(10) is too aggressive backoff.

Reviewed By: vitalybuka

Differential Revision: https://reviews.llvm.org/D106350
parent 9226e6f7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment