1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
Description: Use size_t type for max() comparison
size_t is defined in an architecture-specific way. Construct size_t from int to avoid
the type mismatch error.
Author: Vladimir Petko <vladimir.petko@canonical.com>
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libthread-pool/+bug/2009537
Bug-Debian: https://bugs.debian.org/1032532
Last-Update: 2023-03-08
--- a/include/thread_pool/thread_pool.hpp
+++ b/include/thread_pool/thread_pool.hpp
@@ -24,7 +24,7 @@
std::size_t num_threads = std::thread::hardware_concurrency())
: threads_(),
thread_map_(),
- queues_(std::max(1UL, num_threads)),
+ queues_(std::max(size_t(1), num_threads)),
task_id_(0) {
for (std::size_t i = 0; i != queues_.size(); ++i) {
threads_.emplace_back([this, i] () -> void { Task(i); });
|