Waiting for all requests to complete?

Feb 26, 2016 at 3:07 PM
Hi All,

Is it possible to call a command that causes the calling thread to suspend until all asynchronous tasks have completed? I'm managing some of my stuff in a singleton, and it (intermittently) seems to be getting destroyed before all tasks have finished, resulting in a lambda getting called at a bad time.

If not I might try making my singleton a std::shared_ptr and having the lambdas claim ownership... maybe.
  • John