| 1100 | static std::mutex mtx; |
| 1101 | static auto wait_time = std::chrono::milliseconds(100); |
| 1102 | static void draw_next_frame() { |
| 1103 | // don't need lock because only one thread modifies running |
| 1104 | frame = (frame + 1) % sizeof(LOADING_CHARS); |
| 1105 | replace_last(LOADING_CHARS[frame]); |
| 1106 | fflush(out); |
| 1107 | } |
| 1108 | void start() { |
| 1109 | std::unique_lock<std::mutex> lock(mtx); |
| 1110 | if (simple_io || running) { |