Fix Core::hasCallback to return true for State::Empty
Summary: This specifically fixes a TSAN detected race where SemiFuture destructor was checking Core state to see if deferred executor has to be detached, while that state could become Empty if the callback is being proxied and both threads code be racing while accessing the executor. hasCallback() checks if the callback was ever set (not if the callback is stil alive) and it's true for State::Empty (similar to State::Done). Differential Revision: D24271346 fbshipit-source-id: 5f52f20783d36745d1200497e0300bc086b65213
Showing
Please register or sign in to comment