之前提到单字节且为 POD 结构的自旋锁实现
其实现更需要 CPU 底层指令的支持。具体不多说。想说的一个有意思的地方在于，实现文件的最前面提出：
N.B. You most likely do not want to use PicoSpinLock or any other kind of spinlock. Consider MicroLock instead.
In short, spinlocks in preemptive multi-tasking operating systems have serious problems and fast mutexes like std::mutex are almost certainly the better choice, because letting the OS scheduler put a thread to sleep is better for system responsiveness and throughput than wasting a timeslice repeatedly querying a lock held by a thread that's blocked, and you can't prevent userspace programs blocking.
Spinlocks in an operating system kernel make much more sense than they do in userspace.
Q. E. D.