simplify Core state-space
Summary: Remove Armed: it added an avoidable extra state transition, plus avoidable semantic complexity in the behavior/contract of setResult() & setCallback(), i.e., if either of those transitioned to Armed, that thread may or may not be the one that made the transition to Done with the possibly-synchronous call to the callback. After this change there is only one transition after Only* - to Done, and the new contract/behavior of setResult/setCallback is still asynchronous (the caller cannot know which thread will call the callback) but at least has only one asynchrony instead of two (the thread that transitions to Done is always the thread that calls doCallback()). Reviewed By: yfeldblum Differential Revision: D8049396 fbshipit-source-id: 89a1e40ab8c09db4c8ab0ac3a1fd2cc5e092830d
Showing
Please register or sign in to comment