X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2Fio%2Fasync%2FEventBase.h;h=fff75adb00527d7938c528a07b4894ff4d730ef5;hb=25ddbd7f566e7ea55e64c8e2afed576814b4cb69;hp=9df035235a7d60946a28c014cf239c55728edbf5;hpb=7457019029c72a082174078357c67e2e176f21d4;p=folly.git diff --git a/folly/io/async/EventBase.h b/folly/io/async/EventBase.h index 9df03523..fff75adb 100644 --- a/folly/io/async/EventBase.h +++ b/folly/io/async/EventBase.h @@ -654,11 +654,10 @@ class EventBase : private boost::noncopyable, } void keepAliveRelease() override { - if (inRunningEventBaseThread()) { - loopKeepAliveCount_--; - } else { - add([=] { loopKeepAliveCount_--; }); + if (!inRunningEventBaseThread()) { + return add([=] { keepAliveRelease(); }); } + loopKeepAliveCount_--; } private: