Skip to content

关于timer的删除问题 #623

Answered by chenshuo
yinghaoyu asked this question in Q&A
Jul 22, 2022 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

gdb 调试 bin/timerqueue_unittest,在第 158 行设断点,

  156   else if (callingExpiredTimers_)
  157   {
  158     cancelingTimers_.insert(timer);
  159   }

然后

(gdb) bt

#0  std::set<>::insert () at /usr/include/c++/11/bits/stl_set.h:509
#1  muduo::net::TimerQueue::cancelInLoop (this=, timerId=...) at TimerQueue.cc:158
#2  in muduo::net::TimerQueue::cancel (this=, timerId=...) at /usr/include/c++/11/tuple:1090
#3  in cancel (timer=...) at TimerQueue_unittest.cc:31
#4  in std::function<void ()>::operator()() const (this=) at std_function.h:586
#5  muduo::net::Timer::run (this=) at Timer.h:39
#6  muduo::net::TimerQueue::handleRead (this=) at TimerQueue.cc:176
#7  in std::function<void (muduo::Timesta…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@yinghaoyu
Comment options

@chenshuo
Comment options

@yinghaoyu
Comment options

@chenshuo
Comment options

Answer selected by yinghaoyu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants