| 1071 | static std::mutex mtx; |
| 1072 | static auto wait_time = std::chrono::milliseconds(100); |
| 1073 | static void draw_next_frame() { |
| 1074 | // don't need lock because only one thread modifies running |
| 1075 | frame = (frame + 1) % sizeof(LOADING_CHARS); |
| 1076 | replace_last(LOADING_CHARS[frame]); |
| 1077 | fflush(out); |
| 1078 | } |
| 1079 | void start() { |
| 1080 | std::unique_lock<std::mutex> lock(mtx); |
| 1081 | if (simple_io || running) { |