摘要: 使用 C++11 原子类型 std::atomic_flag 实现的自旋锁: #include <atomic> class Spinlock { public: Spinlock(): flag(ATOMIC_FLAG_INIT) {} void lock() { while (flag.test 阅读全文
posted @ 2023-10-02 11:02 BuzzWeek 阅读(61) 评论(0) 推荐(0) 编辑