
Hi, Is it possible to launch a thread in a coroutine? Such that this code would work: #include <iostream> #include <thread> #include <boost/coroutine/all.hpp> std::thread t; void push_data2(boost::coroutines::coroutine<std::string>::push_type sink) { sink("test2"); } void push_data(boost::coroutines::coroutine<std::string>::push_type& sink) { sink("test1"); t = std::thread(push_data2, std::move(sink)); } int main() { boost::coroutines::coroutine<std::string>::pull_type source(push_data); auto b = boost::begin(source); auto e = boost::end(source); std::cout << *b << std::endl; ++b; std::cout << *b << std::endl; t.join() return 0; } Output: test1 parser: /usr/local/include/boost/smart_ptr/intrusive_ptr.hpp:162: T* boost::intrusive_ptr<T>::operator->() const [with T = boost::coroutines::detail::push_coroutine_base<std::basic_string<char>
]: Assertion `px != 0' failed. Aborted (core dumped)