Ensure getVia(eventbase) does not busy wait
authorDave Watson <davejwatson@fb.com>
Tue, 2 Aug 2016 21:05:35 +0000 (14:05 -0700)
committerFacebook Github Bot 3 <facebook-github-bot-3-bot@fb.com>
Tue, 2 Aug 2016 21:08:39 +0000 (14:08 -0700)
commit62cc06728355f8f1cdaff8b466756fa762a277b1
treee11f68c5de4f16306f19ca41bb7af88459d14fa1
parent4bd3e568094414d1135e2dcab5cdff14d84ed0d1
Ensure getVia(eventbase) does not busy wait

Summary:
Currently, getVia(eventbase) will busy wait if no work is scheduled on the event base.

Tweak the DrivableExecutor API a bit to support sleeping/wakeups.
There was already a similar fix for the only other existing DrivableExecutor, the ManualExecutor, in
D2906858.

Reviewed By: andriigrynenko

Differential Revision: D3613954

fbshipit-source-id: 9ff9f2e010040d9886fdf51a665e3afabbff57c0
folly/futures/DrivableExecutor.h
folly/futures/Future-inl.h
folly/io/async/EventBase.h
folly/io/async/test/EventBaseTest.cpp