From bcc965164ab0863c17318c929fcd39a984485a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Canberk=20S=C3=B6nmez?= Date: Thu, 19 Oct 2023 10:11:40 +0200 Subject: [PATCH] Aync(...) exception behavior corrected. --- include/cxxdes/core/impl/async.ipp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/cxxdes/core/impl/async.ipp b/include/cxxdes/core/impl/async.ipp index 55b0d47..3936972 100644 --- a/include/cxxdes/core/impl/async.ipp +++ b/include/cxxdes/core/impl/async.ipp @@ -12,6 +12,10 @@ struct async_functor { void await_bind(environment *env, priority_type priority) { p.await_bind(env, priority); + if (!p.await_ready()) + // make sure that the completion token is setup correctly + // required to handle exceptions from async(...) + p.await_suspend(nullptr); } bool await_ready() {