Skip to content

Commit

Permalink
remove a piece of optional code in TimerThread.run, which has access-…
Browse files Browse the repository at this point in the history
…after-return issue and may cause the heap popped wrongly
  • Loading branch information
jamesge committed Jul 24, 2020
1 parent 2071a22 commit ea87ee7
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions src/bthread/timer_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ea87ee7

Please sign in to comment.