Hold scoped_gc_epoch for fewer instructions

上级 9e839f9a
......@@ -228,10 +228,12 @@ futexwake(futexkey_t key, u64 nwake)
if (nwake == 0)
return -1;
scoped_gc_epoch gc;
fa = nsfutex->lookup(key);
if (fa == nullptr || !fa->tryinc())
return 0;
{
scoped_gc_epoch gc;
fa = nsfutex->lookup(key);
if (fa == nullptr || !fa->tryinc())
return 0;
}
auto cleanup = scoped_cleanup([&fa](){
fa->dec();
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论