(wangle) set* should not invalidate getFuture
authorHans Fugal <fugalh@fb.com>
Wed, 23 Jul 2014 22:12:19 +0000 (15:12 -0700)
committerChip Turner <chip@fb.com>
Fri, 25 Jul 2014 16:07:12 +0000 (09:07 -0700)
commit56df65bec3cbea1b84da4a4a03772de40cf2e200
tree8af9f1082d788c4bf23f7f1caa674a65348b5c9e
parenta99854ba26a8ca70dcc55649db48446e33ad02f1
(wangle) set* should not invalidate getFuture

Summary: @jcoens observed in D1451114 that it was unintuitive that you have to retrieve the `Future` before fulfilling the `Promise`. That seemed wrong to me too, but sure enough when I wrote the unit tests that doesn't work (throws "promise already fulfilled" when you call `getFuture`). I think this is just a simple mistake, but I'm going to carefully look at the output of contbuild test suites before committing.

Test Plan:
red-green
careful dependency unit test inspection

Reviewed By: jon.coens@fb.com

Subscribers: net-systems@, fugalh, exa, jcoens

FB internal diff: D1453780
folly/wangle/Promise-inl.h
folly/wangle/test/FutureTest.cpp