*/
#include <folly/Memory.h>
#include <folly/fibers/EventBaseLoopController.h>
-#include <folly/fibers/FiberManager.h>
namespace folly {
namespace fibers {
}
inline void EventBaseLoopController::runLoop() {
- fm_->loopUntilNoReady();
+ if (loopRunner_) {
+ loopRunner_->run([&] { fm_->loopUntilNoReady(); });
+ } else {
+ fm_->loopUntilNoReady();
+ }
}
inline void EventBaseLoopController::scheduleThreadSafe(
*/
#pragma once
+#include <folly/fibers/FiberManager.h>
#include <folly/fibers/LoopController.h>
#include <folly/io/async/EventBase.h>
#include <atomic>
namespace folly {
namespace fibers {
-class FiberManager;
-
class EventBaseLoopController : public LoopController {
public:
explicit EventBaseLoopController();
return eventBase_;
}
+ void setLoopRunner(InlineFunctionRunner* loopRunner) {
+ loopRunner_ = loopRunner;
+ }
+
private:
class ControllerCallback : public folly::EventBase::LoopCallback {
public:
FiberManager* fm_{nullptr};
std::atomic<bool> eventBaseAttached_{false};
std::weak_ptr<void> aliveWeak_;
+ InlineFunctionRunner* loopRunner_{nullptr};
/* LoopController interface */