in thread pools, take factory as shared ptr
[folly.git] / folly / experimental / wangle / concurrent / ThreadPoolExecutor.h
index 54819ad6080ff35ce58da6dd4add7d0dd9cfd656..7cbbb3215ea6aa97959a2922c6675c35c7779b36 100644 (file)
@@ -35,7 +35,7 @@ class ThreadPoolExecutor : public experimental::Executor {
  public:
   explicit ThreadPoolExecutor(
       size_t numThreads,
-      std::unique_ptr<ThreadFactory> threadFactory);
+      std::shared_ptr<ThreadFactory> threadFactory);
 
   ~ThreadPoolExecutor();
 
@@ -157,7 +157,7 @@ class ThreadPoolExecutor : public experimental::Executor {
     std::queue<ThreadPtr> queue_;
   };
 
-  std::unique_ptr<ThreadFactory> threadFactory_;
+  std::shared_ptr<ThreadFactory> threadFactory_;
   ThreadList threadList_;
   RWSpinLock threadListLock_;
   StoppedThreadQueue stoppedThreads_;