| 1077 | fflush(out); |
| 1078 | } |
| 1079 | void start() { |
| 1080 | std::unique_lock<std::mutex> lock(mtx); |
| 1081 | if (simple_io || running) { |
| 1082 | return; |
| 1083 | } |
| 1084 | common_log_flush(common_log_main()); |
| 1085 | fprintf(out, "%c", LOADING_CHARS[0]); |
| 1086 | fflush(out); |
| 1087 | frame = 1; |
| 1088 | running = true; |
| 1089 | th = std::thread([]() { |
| 1090 | std::unique_lock<std::mutex> lock(mtx); |
| 1091 | while (true) { |
| 1092 | if (cv_stop.wait_for(lock, wait_time, []{ return !running; })) { |
| 1093 | break; |
| 1094 | } |
| 1095 | draw_next_frame(); |
| 1096 | } |
| 1097 | }); |
| 1098 | } |
| 1099 | void stop() { |
| 1100 | { |
| 1101 | std::unique_lock<std::mutex> lock(mtx); |
no test coverage detected