You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by ja...@apache.org on 2020/07/24 08:26:08 UTC

[incubator-brpc] branch master updated: remove a piece of optional code in TimerThread.run, which has access-after-return issue and may cause the heap popped wrongly

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 <jg...@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-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org