diff --git a/cmake/CPM.cmake b/cmake/CPM.cmake index 176748d..37550b6 100644 --- a/cmake/CPM.cmake +++ b/cmake/CPM.cmake @@ -1,4 +1,4 @@ -set(CPM_DOWNLOAD_VERSION 0.38.1) +set(CPM_DOWNLOAD_VERSION 0.40.2) if(CPM_SOURCE_CACHE) # Expand relative path. This is important if the provided path contains a tilde (~) diff --git a/include/thread_pool/thread_pool.h b/include/thread_pool/thread_pool.h index 14f841e..95485d5 100644 --- a/include/thread_pool/thread_pool.h +++ b/include/thread_pool/thread_pool.h @@ -250,7 +250,9 @@ namespace dp { */ size_t clear_tasks() { size_t removed_task_count{0}; - for (auto &task_list : tasks_) removed_task_count += task_list.tasks.clear(); + for (auto &task_list : tasks_) { + removed_task_count += task_list.tasks.clear(); + } in_flight_tasks_.fetch_sub(removed_task_count, std::memory_order_release); unassigned_tasks_.fetch_sub(removed_task_count, std::memory_order_release);