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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user