diff options
| author | 2024-01-15 11:28:18 -0800 | |
|---|---|---|
| committer | 2024-01-16 09:29:11 +0000 | |
| commit | 466ed0f1e775edd8120fdea698d9a00603470a01 (patch) | |
| tree | e9e5375c5d096d331553b6810f57765adc8399a1 | |
| parent | d3cec8758c9f9bf61bbe1a2b805028e394fea78d (diff) | |
Fix off-by-1 error, avoiding underflow in CHECK
Bug: 319953817
Test: Treehugger
Change-Id: Ib269fa171da22a934869419e29258bcd8161502e
| -rw-r--r-- | runtime/thread_list.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/thread_list.cc b/runtime/thread_list.cc index 979c293c73..d69ad35a9e 100644 --- a/runtime/thread_list.cc +++ b/runtime/thread_list.cc @@ -739,11 +739,11 @@ std::optional<std::string> ThreadList::WaitForSuspendBarrier(AtomicInteger* barr std::string sampled_state = t == 0 ? "" : GetThreadState(t); while (i < kSuspendBarrierIters) { if (WaitOnceForSuspendBarrier(barrier, cur_val, thread_suspend_timeout_ns_)) { + ++i; #if ART_USE_FUTEXES CHECK_GE(NanoTime() - start_time, i * thread_suspend_timeout_ns_ / kSuspendBarrierIters - 1'000'000); #endif - ++i; } cur_val = barrier->load(std::memory_order_acquire); if (cur_val <= 0) { |