Avoid calling emplace_back from collectN future callbacks
Summary: Currently, `collectN` attaches a callback to each input future. When the callback fires, it calls `emplace_back` on vector `ctx->v` with the result of the future. As the added unit test shows, this does not work if the futures are completed in parallel. See https://fb.facebook.com/groups/474291069286180/permalink/1838209692894304/ for more discussion. Reviewed By: yfeldblum Differential Revision: D7372982 fbshipit-source-id: 875eff19172bdbfb7d4f687911f4fa22061e4ed8
Showing
Please register or sign in to comment