]> git.seodisparate.com - EntityComponentMetaSystem/commitdiff
Add ThreadPool::getThreadCount()
authorStephen Seo <seo.disparate@gmail.com>
Tue, 7 Sep 2021 11:18:41 +0000 (20:18 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Tue, 7 Sep 2021 11:18:41 +0000 (20:18 +0900)
Without the previously removed THREADCOUNT constant, there was no way to
query the ThreadCount from outside the class. This function provides
this.

src/EC/ThreadPool.hpp

index 22da28e4daeebd1de2b1bea219486df16205972e..d3808ecb382a05f1ea22e70f5550369893b31cfe 100644 (file)
@@ -172,6 +172,13 @@ public:
         return fnQueue.empty();
     }
 
+    /*!
+        \brief Returns the ThreadCount that this class was created with.
+     */
+    unsigned int getThreadCount() {
+        return SIZE;
+    }
+
 private:
     std::vector<std::thread> threads;
     std::atomic_bool isAlive;