Fix potential deadlock in AsyncGenerator when used with blockingWait()
Summary: The AsyncGenerator was not clearing its Executor::KeepAlive when it ran to completion. This meant that when you call `blockingWait(gen.next())` and this would result in the end-of-stream (error or done) then `blockingWait()` would never return because the destructor of the local executor created in the call was blocked waiting for all KeepAlive instances to be destroyed - but this would not happen until the AsyncGenerator was destroyed. AsyncGenerator now clears the caller context (which includes the KeepAlive) when the coroutine runs to completion. Reviewed By: kirkshoop Differential Revision: D19625741 fbshipit-source-id: f3254181af14828b32bfa8f7ef5d400d53c04efa
Showing
Please register or sign in to comment