I have coroutine IAsyncAction Foo, Which will be called once at the start of my program.
I also have coroutine IAsyncAction Bar which will be called multiple times, arbitrarily, and must await for Foo at some point.
Can the multiple calls to Bar await for a single call of Foo like this?
IAsyncAction m_fooAction = Foo();
(Later, within Bar...)
co_await m_fooAction;
I tried this, but I keep getting an error:
A delegate was assigned when not allowed (see https://learn.microsoft.com/en-us/uwp/cpp-ref-for-winrt/error-handling/hresult-illegal-delegate-assignment).
Please note:
This development is for a Windows 8 Desktop app, so can't use CoreDispatcher nor DispatcherQueue.