Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
snnn committed Dec 13, 2024
1 parent b74efed commit 7dada0b
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1470,10 +1470,7 @@ class ThreadPoolTempl : public onnxruntime::concurrency::ExtendedThreadPoolInter
void SetBlocked(std::function<bool()> should_block,
std::function<void()> post_block) {
std::unique_lock<std::mutex> lk(mutex);
auto old_status = status.exchange(ThreadStatus::Blocking, std::memory_order_seq_cst);
if(old_status != ThreadStatus::Spinning){
abort();
}
ORT_ENFORCE(status.exchange(ThreadStatus::Blocking, std::memory_order_seq_cst) == ThreadStatus::Spinning);
if (should_block()) {
status.store(ThreadStatus::Blocked, std::memory_order_relaxed);
do {
Expand Down

0 comments on commit 7dada0b

Please sign in to comment.