From 71d0dd7fa8165a80fd9b93d99c541d550fcdfe70 Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Thu, 5 Oct 2017 17:02:00 -0700 Subject: [PATCH] Use fewer keep-alives in VirtualEventBase::keepAliveRelease Summary: [Folly] Use fewer keep-alives in `VirtualEventBase::keepAliveRelease`. {D5982132} mistakenly used `VirtualEventBase::add`, which holds a keep-alive on the master `EventBase`, instead of calling `EventBase::add` directly. (Note: this ignores all push blocking failures!) Reviewed By: andriigrynenko Differential Revision: D5992403 fbshipit-source-id: f427025c06f01e6a93d6eae8a051c3553f58be20 --- folly/io/async/VirtualEventBase.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/folly/io/async/VirtualEventBase.h b/folly/io/async/VirtualEventBase.h index ebf928aa..539e7706 100644 --- a/folly/io/async/VirtualEventBase.h +++ b/folly/io/async/VirtualEventBase.h @@ -140,8 +140,8 @@ class VirtualEventBase : public folly::Executor, public folly::TimeoutManager { } void keepAliveRelease() override { - if (!inRunningEventBaseThread()) { - return add([=] { keepAliveRelease(); }); + if (!evb_.inRunningEventBaseThread()) { + return evb_.add([=] { keepAliveRelease(); }); } if (loopKeepAliveCountAtomic_.load()) { loopKeepAliveCount_ += loopKeepAliveCountAtomic_.exchange(0); -- 2.34.1