jeremyong/coop

joinable_coroutine: Cannot join a task without the Joinable type

Closed this issue · 2 comments

When I tried the joinable_coroutine example with VS2022, it broke as:
Cannot join a task without the Joinable type!

It should be here that fail:
coroutine_.promise().join_sem.acquire()
Fail to acquire Invariant: semaphore counter is non-negative and doesn't exceed max(),
_Prev is 221 something in C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.30.30705\include\semaphore (line 242)

Hey, if you want a task to be joinable, you need to change the task_t signature to have true as the second template parameter, since joinable tasks incur a small amount of extra overhead. Search for "join" on the readme for usage examples. Thanks!