提交 4a5f291a 编写于 作者: Z zhangchao19 提交者: Jiangtao Hu

framework: format foreach in scheduler

上级 47645d91
......@@ -40,9 +40,7 @@ std::shared_ptr<CRoutine> ClassicContext::NextRoutine() {
}
for (int i = MAX_PRIO - 1; i >= 0; --i) {
ReadLockGuard<AtomicRWLock> lk(rq_locks_[i]);
for (auto it = rq_[i].begin(); it != rq_[i].end(); ++it) {
auto cr = (*it);
for (auto& cr : rq_[i]) {
if (!cr->Acquire()) {
continue;
}
......
......@@ -49,9 +49,8 @@ void Processor::SetAffinity(const std::vector<int> &cpus,
if (cpus.size()) {
if (!affinity.compare("range")) {
for (std::vector<int>::const_iterator it = cpus.begin(), e = cpus.end();
it != e; it++) {
CPU_SET(*it, &set);
for (const auto cpu : cpus) {
CPU_SET(cpu, &set);
}
pthread_setaffinity_np(thread_.native_handle(), sizeof(set), &set);
} else if (!affinity.compare("1to1")) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册