Browse Source

fix(mgb/core): fix allocate_task_block_unsafe in thread_impl_1.h

GitOrigin-RevId: 21b92fafc5
release-1.3
Megvii Engine Team 4 years ago
parent
commit
d13b6a4a51
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      src/core/include/megbrain/utils/thread_impl_1.h

+ 3
- 1
src/core/include/megbrain/utils/thread_impl_1.h View File

@@ -365,14 +365,16 @@ namespace mgb {
if (!m_free_task_block.empty()) {
ret = std::move(m_free_task_block.back());
m_free_task_block.pop_back();
break;
} else if (m_block_quota > 0) {
ret = std::make_unique<TaskBlock>();
m_block_quota--;
break;
} else {
m_cv.wait(m_mutex);
continue;
}
} while (false);
} while (true);
ret->first_tid = m_new_block_first_tid;
m_new_block_first_tid += BLOCK_SIZE;
ret->prev = prev;


Loading…
Cancel
Save