Skip to content

Commit

Permalink
Use overriden resume for co_await on tasklet
Browse files Browse the repository at this point in the history
Issue here is that if mixed-mode resumption ends up in use,
then a deferred resume can "continue" after a co_await
immediate resume, and then the coroutine handle used
for the deferred resume is dangling.
  • Loading branch information
dwd committed Nov 7, 2023
1 parent 4c7a591 commit eac8cac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sigslot/tasklet.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <sigslot/sigslot.h>
#include <coroutine>
#include <string>
#include <stdexcept>

namespace sigslot {
template<typename T> struct tasklet;
Expand Down Expand Up @@ -103,7 +104,7 @@ namespace sigslot {

void resolve() {
resolved = true;
if (awaiting) awaiting.resume();
if (awaiting) resume(awaiting);
}

virtual ~awaitable_base() = default;
Expand Down

0 comments on commit eac8cac

Please sign in to comment.