Open matthijs opened 1 day ago
The .join()
blocks the executor
, so it cannot deliver the completion. You need to co_await thr
, but since main is cancelled at that point you'll need to disable throw_on_cancel
first or reset the cancellation state.
std::cout << "joining thread\n";
co_await cobalt::this_coro::reset_cancellation_state();
co_await thr;
std::cout << "yey done!\n"; // never gets here
Hi,
I have a concurrent_channel which signals a thread when work is available. But when quitting the application (Ctrl-c) the thread will not finish.
Here is a small reproducible example:
I expected the application to quit correctly after closing the channel and joining the thread. But instead it never gets to the line 'yey done!'...
My environment: Compiler: clang++-19 C++ stdandard 20 Using std libary from llvm