1. Here is my test code:
int main(int args, char** argv, char** env) {
seastar::app_template app;
return app.run(args, argv, [&] {
auto fut1 = seastar::thread([] {
std::cout << "test 1" << std::endl;
});
return seastar::async([&] {
std::cout << "test 2" << std::endl;
});
});
}
it got errors like:
2. But if add a then() after async() :
int main(int args, char** argv, char** env) {
seastar::app_template app;
return app.run(args, argv, [&] {
auto fut1 = seastar::thread([] {
std::cout << "test 1" << std::endl;
});
return seastar::async([&] {
std::cout << "test 2" << std::endl;
}).then([] {
std::cout << "test 3" << std::endl;
});
});
}
It runs well:
3. FYI:
There is a comment is utils/critical_alloc_section.hh:
Is this the reason?