This is an automated email from the ASF dual-hosted git repository.

jamesge pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new ea87ee7  remove a piece of optional code in TimerThread.run, which has 
access-after-return issue and may cause the heap popped wrongly
ea87ee7 is described below

commit ea87ee715b04e30a4ee255953ac94cd0f6672b59
Author: jamesge <jge...@gmail.com>
AuthorDate: Fri Jul 24 16:25:51 2020 +0800

    remove a piece of optional code in TimerThread.run, which has 
access-after-return issue and may cause the heap popped wrongly
---
 src/bthread/timer_thread.cpp | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/bthread/timer_thread.cpp b/src/bthread/timer_thread.cpp
index 8d85b63..88bdcf2 100644
--- a/src/bthread/timer_thread.cpp
+++ b/src/bthread/timer_thread.cpp
@@ -367,11 +367,6 @@ void TimerThread::run() {
         bool pull_again = false;
         while (!tasks.empty()) {
             Task* task1 = tasks[0];  // the about-to-run task
-            if (task1->try_delete()) { // already unscheduled
-                std::pop_heap(tasks.begin(), tasks.end(), task_greater);
-                tasks.pop_back();
-                continue;
-            }
             if (butil::gettimeofday_us() < task1->run_time) {  // not ready 
yet.
                 break;
             }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to