async
alternative syntax.
static int foo(int i)
{
printf("foo %d\n", i);
return i;
}
{
foo_type::future future3 =
zth::fiber(foo,
"foo(3)")(3).withFuture();
future3->wait();
foo_type::future future4 = fiber4;
printf("Returned %d\n", future4->value());
#if __cplusplus >= 201103L
future5->wait();
#endif
return 0;
}
Change the name of a fiber returned by async.
int main_fiber(int argc, char **argv)
fiber_type< F >::factory fiber(F f, char const *name=nullptr)
Create a new fiber.