| 1106 | fflush(out); |
| 1107 | } |
| 1108 | void start() { |
| 1109 | std::unique_lock<std::mutex> lock(mtx); |
| 1110 | if (simple_io || running) { |
| 1111 | return; |
| 1112 | } |
| 1113 | common_log_flush(common_log_main()); |
| 1114 | fprintf(out, "%c", LOADING_CHARS[0]); |
| 1115 | fflush(out); |
| 1116 | frame = 1; |
| 1117 | running = true; |
| 1118 | th = std::thread([]() { |
| 1119 | std::unique_lock<std::mutex> lock(mtx); |
| 1120 | while (true) { |
| 1121 | if (cv_stop.wait_for(lock, wait_time, []{ return !running; })) { |
| 1122 | break; |
| 1123 | } |
| 1124 | draw_next_frame(); |
| 1125 | } |
| 1126 | }); |
| 1127 | } |
| 1128 | void stop() { |
| 1129 | { |
| 1130 | std::unique_lock<std::mutex> lock(mtx); |
no test coverage detected