From 4a3e7d8fa46dfe349604c6e59592d5c32eb744dc Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Tue, 20 Sep 2022 17:45:55 +0200 Subject: [PATCH] common/src/key_search.hpp: Adding getThreadCount() --- common/include/eoskeygen/key_search.hpp | 2 ++ common/src/key_search_mt.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/common/include/eoskeygen/key_search.hpp b/common/include/eoskeygen/key_search.hpp index 902716f..b7fa5af 100644 --- a/common/include/eoskeygen/key_search.hpp +++ b/common/include/eoskeygen/key_search.hpp @@ -69,6 +69,8 @@ public : // Set the number of threads to use while searching. void setThreadCount(size_t num); + + size_t getThreadCount() const; #endif /* EOSIOKEYGEN_HAVE_THREADS */ // Aborts find() operation if started. diff --git a/common/src/key_search_mt.cpp b/common/src/key_search_mt.cpp index 8c1585b..b0773ba 100644 --- a/common/src/key_search_mt.cpp +++ b/common/src/key_search_mt.cpp @@ -73,6 +73,11 @@ size_t KeySearch::max_threads() return std::thread::hardware_concurrency(); } +size_t KeySearch::getThreadCount() const +{ + return m_threads; +} + void KeySearch::_search_mt() { std::vector t;