28 itsThread = std::thread([&]{
29 struct timeval tv; fd_set fds; tv.tv_sec = 0; tv.tv_usec = 30000;
30 while (itsRunning.load())
33 FD_SET(STDIN_FILENO, &fds);
34 int ret = select(STDIN_FILENO+1, &fds, nullptr, nullptr, &tv);
35 if (ret == -1) LERROR(
"Ignoring error on stdin: " << strerror(errno));
38 std::string str; std::getline(std::cin, str);
39 std::lock_guard<std::mutex> _(itsMtx);
40 itsString = std::move(str);