//--------------------------------------------------------- // com.thread.cc //--------------------------------------------------------- #include #include #include #include int main() { std::array msg = {'\0'}; std::thread escritor([&] { std::iota(msg.begin(), msg.end() - 1, 'a'); std::cout << "writer: " << msg.data() << std::endl; }); std::thread lector([&] { std::cout << "reader: " << msg.data() << std::endl; }); escritor.join(); lector.join(); }