欢迎光临
我们一直在努力

两个 unsigned 就是一把锁:Dragonfly 用 6 行 C++ 干掉了跨线程锁管理器

先看 Dragonfly 里最反直觉的六行代码,src/core/intent_lock.h:20-26:

// Returns true if lock was acquired. In any case, the intent is recorded.
bool Acquire(Mode m) {


++cnt_[m];

if (cnt_[1 ^

赞(0)
未经允许不得转载:171主机测评 » 两个 unsigned 就是一把锁:Dragonfly 用 6 行 C++ 干掉了跨线程锁管理器
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址