experimental

C++ coroutines: The problem of the DispatcherQueue task that runs too soon, part 3--Raymond Chen

The series contine.

C++ coroutines: The problem of the DispatcherQueue task that runs too soon, part 3

by Raymond Chen

From the article:

Last time, we fixed a race condition in C++/WinRT’s resume_foreground(Dispatcher­Queue) function when it tries to resume execution on a dispatcher queue. We did this by having the queued task wait until await_suspend was finished before allowing the coroutine to resume. The hard part was finding a place to put the synchronization object, and we ended up putting it in the queued task’s lambda...

C++ coroutines: The co_await operator and the function search algorithm--Raymond Chen

The series continue.

C++ coroutines: The co_await operator and the function search algorithm

by Raymond Chen

From the article:

So you’re following along Kenny Kerr’s blog and you get to the part where he uses co_await on a time duration:

co_await 5s;

so you try it:

#include <chrono>
using namespace std::chrono;

winrt::IAsyncAction Delay10Seconds()
{
   co_await 10s;
   co_return;
}

and you get the error message

no callable ‘await_resume’ function found for type ‘Expression’ where Expression=std::chrono::seconds