提交 61789426 创建 作者: Austin Clements's avatar Austin Clements

Assert if work queues are used too early

上级 38fd95b5
......@@ -30,12 +30,14 @@ wq_size(void)
int
wq_push(work *w)
{
assert(wq_);
return wq_->push(w, mycpuid());
}
void
wqcrit_trywork(void)
{
assert(wqcrit_);
while (wqcrit_->trywork(false))
;
}
......@@ -43,18 +45,21 @@ wqcrit_trywork(void)
int
wqcrit_push(work *w, int c)
{
assert(wqcrit_);
return wqcrit_->push(w, c);
}
int
wq_trywork(void)
{
assert(wq_ && wqcrit_);
return wqcrit_->trywork(false) || wq_->trywork(true);
}
void
wq_dump(void)
{
if (wq_)
return wq_->dump();
}
......
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论