diff --git a/include/destroy_manager.h b/include/destroy_manager.h index 741bcaa..a98be36 100644 --- a/include/destroy_manager.h +++ b/include/destroy_manager.h @@ -14,7 +14,7 @@ class destroy_manager { std::size_t expected{ destroy_threads_num_.load(std::memory_order_acquire)}; for (;;) { - if (expected >= std::thread::hardware_concurrency()) { + if (expected >= hardware_concurrency_) { return false; } std::size_t desired = expected + 1; @@ -34,6 +34,7 @@ class destroy_manager { private: static inline std::atomic destroy_threads_num_{0}; // NOLINT + static inline std::size_t hardware_concurrency_{std::thread::hardware_concurrency()}; // NOLINT }; } // namespace yakushima