mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 19:46:02 +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:
parent
d5402b8527
commit
1f65b08d94
1 changed files with 3 additions and 2 deletions
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue