Implement LoopKeepAlive for EventBase
authorAndrii Grynenko <andrii@fb.com>
Thu, 5 May 2016 20:22:42 +0000 (13:22 -0700)
committerFacebook Github Bot 6 <facebook-github-bot-6-bot@fb.com>
Thu, 5 May 2016 20:35:42 +0000 (13:35 -0700)
commit2d2aed32cff14f35fd3163276a0475fcd682edf5
tree5f50462a58213c4bf1f5292035aa500f228d5ec4
parent93db3df45dd290f1024b9a4e556f65c549e0c43e
Implement LoopKeepAlive for EventBase

Summary: LoopKeepAlive can be useful to tell EventBase, that loop() shouldn't return even if there are no events registered, because some tasks will later be added via runInEventBaseThread. While at least one LoopKeepAlive is alive - EventBase::loop() behaves like EventBase::loopForever().

Reviewed By: yfeldblum

Differential Revision: D3261706

fb-gh-sync-id: d91424d3d12cae11abd72cffdbd57f136f628dae
fbshipit-source-id: d91424d3d12cae11abd72cffdbd57f136f628dae
folly/io/async/EventBase.cpp
folly/io/async/EventBase.h
folly/io/async/test/EventBaseTest.cpp