Let EventBase::runInEventBaseThreadAndWait consume its argument
authorYedidya Feldblum <yfeldblum@fb.com>
Sat, 7 Oct 2017 01:04:56 +0000 (18:04 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sat, 7 Oct 2017 01:11:44 +0000 (18:11 -0700)
commit662b86a949f85dfcbf966a346dba8306710eabcb
treef7d080b032d9d32ea0cb51f7bdf50577d9bb4326
parent05ced584576f60a3d8f3565d15906ad872fdb979
Let EventBase::runInEventBaseThreadAndWait consume its argument

Summary:
[Folly] Let `EventBase::runInEventBaseThreadAndWait` consume its argument.

Likewise `EventBase::runImmediatelyOrRunInEventBaseThreadAndWait`.

And enforce that the function is destructed before returning, so that, in the case of a wrapped lambda, all captured objects' destructors run before returning from the function.

Reviewed By: elsteveogrande

Differential Revision: D5994106

fbshipit-source-id: 816c9431a85a3d41e4fda321065614f4c18f0697
folly/io/async/EventBase.cpp
folly/io/async/EventBase.h