Fix very low-priority tasks never getting picked

This commit is contained in:
Marc Gilleron 2022-08-13 16:34:45 +01:00
parent b99b93904b
commit 3411a9e1cc

View File

@ -155,7 +155,7 @@ void ThreadedTaskRunner::thread_func(ThreadData &data) {
// Pick best tasks
for (uint32_t bi = 0; bi < _batch_count && _tasks.size() != 0; ++bi) {
size_t best_index = 0; // Take first by default, this is a valid index
int best_priority = 999999;
int best_priority = std::numeric_limits<int>::max();
bool picked_task = false;
// Find best task to pick