Fix broken ManualExecutor
authorHarrison Klaperman <klaperman@fb.com>
Mon, 3 Apr 2017 23:31:57 +0000 (16:31 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 3 Apr 2017 23:35:10 +0000 (16:35 -0700)
commit6e183a441def233594601b53c092734ec2a37520
tree9faea5fda3ac08e33555290612c799828bdcff4c
parent30df0947840ae833b8b6067156dade6e3f6ae7b7
Fix broken ManualExecutor

Summary:
The priority queue in the manual executor implementation is backwards. This means that scheduled things run in reverse order, and a later thing will block an earlier thing if you advance to a timestamp in between the two.

This diff fixes the problem and adds tests to confirm the fix. These tests fail on the old implementation.

Reviewed By: yfeldblum

Differential Revision: D4739101

fbshipit-source-id: 6e429828460df5b3c656580568a9ae1eb4009527
folly/futures/ManualExecutor.h
folly/futures/test/ExecutorTest.cpp