szaszm commented on a change in pull request #735: MINIFICPP-1158 - Event
driven processors can starve each other
URL: https://github.com/apache/nifi-minifi-cpp/pull/735#discussion_r385283533
##########
File path: libminifi/include/utils/ThreadPool.h
##########
@@ -231,7 +198,10 @@ class ThreadPool {
thread_manager_ = nullptr;
}
- ThreadPool(const ThreadPool<T> &&other)
+ ThreadPool(const ThreadPool<T> &other) = delete;
+ ThreadPool<T> operator=(const ThreadPool<T> &other) = delete;
+
+ ThreadPool(ThreadPool<T> &&other)
: daemon_threads_(std::move(other.daemon_threads_)),
thread_reduction_count_(0),
max_worker_threads_(std::move(other.max_worker_threads_)),
Review comment:
`FlowController` hands out references to its `ThreadPool`. Since
`ThreadPool` is movable, it's possible that the handed out references point to
a moved-from object if something/someone (probably not in the current state of
the code) moves the object.
Can we disable move? If move is needed, we may consider double indirection
and updating the pointers on move. Thread safety requires more thinking in the
latter case.
other: Thanks for making the parameter rvalue ref non-const
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services