Commit e4519f66 authored by Dan Melnic's avatar Dan Melnic Committed by Facebook Github Bot

keepAliveRelease code reorg

Summary: keepAliveRelease code reorg

Reviewed By: kevin-vigor

Differential Revision: D17835172

fbshipit-source-id: 48c60b04324f0d9bd1ac628e2625d3d4d2654c99
parent f6ca07e8
...@@ -133,10 +133,7 @@ class VirtualEventBase : public folly::Executor, public folly::TimeoutManager { ...@@ -133,10 +133,7 @@ class VirtualEventBase : public folly::Executor, public folly::TimeoutManager {
return true; return true;
} }
void keepAliveRelease() override { void keepAliveReleaseEvb() {
if (!evb_->inRunningEventBaseThread()) {
return evb_->add([=] { keepAliveRelease(); });
}
if (loopKeepAliveCountAtomic_.load()) { if (loopKeepAliveCountAtomic_.load()) {
loopKeepAliveCount_ += loopKeepAliveCountAtomic_.exchange(0); loopKeepAliveCount_ += loopKeepAliveCountAtomic_.exchange(0);
} }
...@@ -146,6 +143,15 @@ class VirtualEventBase : public folly::Executor, public folly::TimeoutManager { ...@@ -146,6 +143,15 @@ class VirtualEventBase : public folly::Executor, public folly::TimeoutManager {
} }
} }
void keepAliveRelease() override {
if (!evb_->inRunningEventBaseThread()) {
evb_->add([=] { keepAliveReleaseEvb(); });
return;
}
keepAliveReleaseEvb();
}
private: private:
friend class EventBase; friend class EventBase;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment