#include #include int a = 1; int main() { thread_local int b = 2; std::jthread hebras[2]; for (int i = 0; i < 2; ++i) hebras[i] = std::jthread([&] { static int c = 3; printf("a:%d b:%d c:%d\n", ++a, ++b, ++c); }); }