Add a full drain for folly's ManualExecutor.
authorLee Howes <lwh@fb.com>
Mon, 23 Oct 2017 20:36:48 +0000 (13:36 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 23 Oct 2017 20:46:42 +0000 (13:46 -0700)
commite65a4541ca9b6e2751a57b8a824e85023aee210d
treec9c758b4652a13d8fb07ee3ce3f786569151f26f
parent6cc78c358adeb78727a4b2cb60808d9ab1891851
Add a full drain for folly's ManualExecutor.

Summary: ManualExecutor::run() is stable, which means that in cases where we want to fully drain the executor we have to loop over it. This adds ManualExecutor::drain() which does that internally.

Reviewed By: yfeldblum

Differential Revision: D6126840

fbshipit-source-id: e36cba5c373a57fe01de244977ec852636b58dbd
folly/executors/ManualExecutor.cpp
folly/executors/ManualExecutor.h
folly/executors/test/ExecutorTest.cpp