| 1126 | }); |
| 1127 | } |
| 1128 | void stop() { |
| 1129 | { |
| 1130 | std::unique_lock<std::mutex> lock(mtx); |
| 1131 | if (simple_io || !running) { |
| 1132 | return; |
| 1133 | } |
| 1134 | running = false; |
| 1135 | cv_stop.notify_all(); |
| 1136 | } |
| 1137 | if (th.joinable()) { |
| 1138 | th.join(); |
| 1139 | } |
| 1140 | replace_last(' '); |
| 1141 | pop_cursor(); |
| 1142 | fflush(out); |
| 1143 | } |
| 1144 | } |
| 1145 | |
| 1146 | void log(const char * fmt, ...) { |
no test coverage detected