Fix Cyber - Timing Wheel Concurrency bug
As #15161 stated, there's a concurrency issue under timing wheel.
Considering 3 threads, running the following content
- Thread I: Starts the timer, and spinning for sometime. Then Stops the timer.
- Thread II: The timing wheel thread, ticking new tasks
- Thread III: A task added to TaskManager and running asynchronously
Now Let's say Thread I stops the timer and reset task_ when Thread II has already run line 52 (timing_wheel.cc) & got an instance of the shared pointer. The only shared pointer task is only maintained in Thread II. Let's say somehow the scheduler haven't got enough resource to run Thread III and Thread II finished first. In this case, task_ is released.
If now, Thread III is scheduled by TaskManager and running line 60 (timing_wheel.cc) , since this callback is caught by task->callback, this is a heap-use-after-release problem. This could also be detected by ASAN.
Will check and feedback soon!