Skip to content

Commit

Permalink
reverted decltype change in ThreadPool.h due to warning
Browse files Browse the repository at this point in the history
  • Loading branch information
martinzink committed Jul 20, 2023
1 parent e6a83bb commit 6fdb7f1
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions libminifi/include/utils/ThreadPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@ class Worker {
std::shared_ptr<std::promise<TaskRescheduleInfo>> promise;
};

class DelayedTaskComparator {
public:
bool operator()(Worker &a, Worker &b) {
return a.getNextExecutionTime() > b.getNextExecutionTime();
}
};

class WorkerThread {
public:
explicit WorkerThread(std::thread thread, const std::string &name = "NamelessWorker")
Expand Down Expand Up @@ -270,9 +277,7 @@ class ThreadPool {
std::shared_ptr<controllers::ThreadManagementService> thread_manager_;
ConcurrentQueue<std::shared_ptr<WorkerThread>> deceased_thread_queue_;
ConditionConcurrentQueue<Worker> worker_queue_;
std::priority_queue<Worker, std::vector<Worker>,
/* comparator: */ decltype([](const Worker& lhs, const Worker& rhs) noexcept { return lhs.getNextExecutionTime() > rhs.getNextExecutionTime(); })
> delayed_worker_queue_;
std::priority_queue<Worker, std::vector<Worker>, DelayedTaskComparator> delayed_worker_queue_;
std::mutex worker_queue_mutex_;
std::condition_variable delayed_task_available_;
std::map<TaskId, bool> task_status_;
Expand Down

0 comments on commit 6fdb7f1

Please sign in to comment.