remove Cpp2WorkerFactory
[folly.git] / folly / experimental / wangle / concurrent / IOThreadPoolExecutor.cpp
index 73b5c61f26377c3139107fb4d10e24a946e4cfb2..f1fa39040c83342cee6ad257f04c5e4844a3de00 100644 (file)
@@ -153,6 +153,16 @@ void IOThreadPoolExecutor::stopThreads(size_t n) {
   }
 }
 
+std::vector<EventBase*> IOThreadPoolExecutor::getEventBases() {
+  std::vector<EventBase*> bases;
+  RWSpinLock::ReadHolder{&threadListLock_};
+  for (const auto& thread : threadList_.get()) {
+    auto ioThread = std::static_pointer_cast<IOThread>(thread);
+    bases.push_back(ioThread->eventBase);
+  }
+  return bases;
+}
+
 // threadListLock_ is readlocked
 uint64_t IOThreadPoolExecutor::getPendingTaskCount() {
   uint64_t count = 0;