| 1059 | } |
| 1060 | |
| 1061 | void FileLoader::cancelCurrent(bool keep_partial) { |
| 1062 | if (ctx_ == nullptr) { |
| 1063 | return; // no worker load in progress (fanout cancellation flows through its modal dialog) |
| 1064 | } |
| 1065 | cancel_mode_.store(keep_partial ? 1 : 2); |
| 1066 | if (ctx_->ingest) { |
| 1067 | // Flag-only stop: cancelCurrent runs on the GUI thread while the worker may be in a |
| 1068 | // host callback, so writing a reason here would race the worker's last_error_. The |
| 1069 | // cooperative stop only needs the atomic flag; the reason is unused on this path. |
| 1070 | ctx_->ingest->requestStop(); |
| 1071 | } |
| 1072 | } |
| 1073 | |
| 1074 | bool FileLoader::isBusy() const { |
| 1075 | return active_load_ || !queue_.empty(); |
no test coverage detected