Fix one more race in Promise::setTry
authorAndrii Grynenko <andrii@fb.com>
Wed, 18 May 2016 00:21:56 +0000 (17:21 -0700)
committerFacebook Github Bot 1 <facebook-github-bot-1-bot@fb.com>
Wed, 18 May 2016 00:23:25 +0000 (17:23 -0700)
commit4ffd39d6962255cf227b7dbda2f76a54759069ac
tree7369f8b62d6cfa6b80c41c7da19d1a084a824a70
parent723206127f727c66ec685038fdcaf72a9353e707
Fix one more race in Promise::setTry

Summary:
Baton::post has to be the last step of Promise::setTry. If Promise is not owned by
the posting thread, it may be destroyed right after Baton::post is called.

Reviewed By: pavlo-fb

Differential Revision: D3312506

fbshipit-source-id: 6d5c3f0925c3bb9cd3f981e7550f888d5ed76189
folly/experimental/fibers/Promise-inl.h