git-hulk commented on code in PR #1493:
URL: 
https://github.com/apache/incubator-kvrocks/pull/1493#discussion_r1227502722


##########
src/common/task_runner.h:
##########
@@ -42,13 +42,7 @@ class TaskRunner {
 
   TaskRunner(const TaskRunner&) = delete;
   TaskRunner& operator=(const TaskRunner&) = delete;
-
-  ~TaskRunner() {
-    if (state_ != Stopped) {
-      Cancel();
-      auto _ = Join();
-    }
-  }
+  ~TaskRunner() = default;

Review Comment:
   The data race may be caused by the task runner's `Join` function will clear 
the concurrent queue, so it could be fixed after moving to the last one to 
join. It's good for me to keep the Cancel and Join in dctor.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to