Use loopKeepAlive() mechanism in FiberManager
[folly.git] / folly / fibers / FiberManagerInternal.h
index 12669c7c9cfaa98de1b1ecbc65394e68f706e348..28c74db641d97178f58fab32cda8b6456a7414a3 100644 (file)
@@ -155,10 +155,13 @@ class FiberManager : public ::folly::Executor {
 
   /**
    * Keeps running ready tasks until the list of ready tasks is empty.
-   *
-   * @return True if there are any waiting tasks remaining.
    */
-  bool loopUntilNoReady();
+  void loopUntilNoReady();
+
+  /**
+   * This should only be called by a LoopController.
+   */
+  void loopUntilNoReadyImpl();
 
   /**
    * @return true if there are outstanding tasks.
@@ -341,8 +344,8 @@ class FiberManager : public ::folly::Executor {
     AtomicIntrusiveLinkedListHook<RemoteTask> nextRemoteTask;
   };
 
-  intptr_t activateFiber(Fiber* fiber);
-  intptr_t deactivateFiber(Fiber* fiber);
+  void activateFiber(Fiber* fiber);
+  void deactivateFiber(Fiber* fiber);
 
   typedef folly::IntrusiveList<Fiber, &Fiber::listHook_> FiberTailQueue;
   typedef folly::IntrusiveList<Fiber, &Fiber::globalListHook_>
@@ -373,8 +376,6 @@ class FiberManager : public ::folly::Executor {
    */
   size_t maxFibersActiveLastPeriod_{0};
 
-  FContext::ContextStruct mainContext_; /**< stores loop function context */
-
   std::unique_ptr<LoopController> loopController_;
   bool isLoopScheduled_{false}; /**< was the ready loop scheduled to run? */