mirror of
https://github.com/NixOS/nix.git
synced 2025-11-18 08:19:35 +01:00
curlFileTransfer::workerThreadEntry Only call quit if we need to.
This commit is contained in:
parent
1f65b08d94
commit
86fb5b24a9
1 changed files with 5 additions and 1 deletions
|
|
@ -781,14 +781,18 @@ struct curlFileTransfer : public FileTransfer
|
||||||
|
|
||||||
void workerThreadEntry()
|
void workerThreadEntry()
|
||||||
{
|
{
|
||||||
|
// Unwinding or because someone called `quit`.
|
||||||
|
bool normalExit = true;
|
||||||
try {
|
try {
|
||||||
workerThreadMain();
|
workerThreadMain();
|
||||||
} catch (nix::Interrupted & e) {
|
} catch (nix::Interrupted & e) {
|
||||||
|
normalExit = false;
|
||||||
} catch (std::exception & e) {
|
} catch (std::exception & e) {
|
||||||
printError("unexpected error in download thread: %s", e.what());
|
printError("unexpected error in download thread: %s", e.what());
|
||||||
|
normalExit = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
if (!normalExit) {
|
||||||
auto state(state_.lock());
|
auto state(state_.lock());
|
||||||
state->quit();
|
state->quit();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue