You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kvrocks.apache.org by "PragmaTwice (via GitHub)" <gi...@apache.org> on 2023/06/13 03:45:30 UTC
[GitHub] [incubator-kvrocks] PragmaTwice commented on a diff in pull request #1493: Fix duplicately join the task runner
PragmaTwice commented on code in PR #1493:
URL: https://github.com/apache/incubator-kvrocks/pull/1493#discussion_r1227489897
##########
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:
Seems we need some guarantee for this object? i.e. the behavior will be undefined while the taskrunner is destructed and the attached threads are still running.
Can refer to std::jthread (https://en.cppreference.com/w/cpp/thread/jthread/~jthread) and std::thread (https://en.cppreference.com/w/cpp/thread/thread/~thread).
--
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: issues-unsubscribe@kvrocks.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org