wwbmmm commented on code in PR #2986:
URL: https://github.com/apache/brpc/pull/2986#discussion_r2144174942


##########
src/bthread/timer_thread.cpp:
##########
@@ -347,6 +347,11 @@ void TimerThread::run() {
         // would run the consumed tasks.
         {
             BAIDU_SCOPED_LOCK(_mutex);
+            if (__builtin_expect(_nearest_run_time == -1, 0)) {

Review Comment:
   May be we can just check `_stop` here, without changing the 
`_nearest_run_time` from 0 to -1 in the `stop_and_join()` function, like this:
   
   ```cpp
   if (_stop.load(xxx)) {
      break;
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to