1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 03:56:01 +01:00

curlFileTransfer::State:quit emptys the queue

Whoever first calls `quit` now empties the queue, instead of waiting for
the worker thread to do it.

(Note that in the unwinding case, the worker thread is still the first
to call `quit`, though.)
This commit is contained in:
John Ericson 2025-09-29 16:37:12 -04:00
parent d5402b8527
commit 1f65b08d94

View file

@ -603,6 +603,9 @@ struct curlFileTransfer : public FileTransfer
void quit()
{
quitting = true;
/* We wil not be processing any more incomming requests */
while (!incoming.empty())
incoming.pop();
}
bool isQuitting()
@ -787,8 +790,6 @@ struct curlFileTransfer : public FileTransfer
{
auto state(state_.lock());
while (!state->incoming.empty())
state->incoming.pop();
state->quit();
}
}