mirror of
https://github.com/NixOS/nix.git
synced 2024-11-22 14:52:55 +00:00
Make some more threads receive interrupts
Shouldn't hurt to do this. In particular, this should speed up
shutting down the PathSubstitutionGoal thread if it's copying from a
remote store.
(cherry picked from commit 295a2ff8bd
)
This commit is contained in:
parent
4b38ebb009
commit
6af94c431b
@ -2,6 +2,7 @@
|
||||
#include "substitution-goal.hh"
|
||||
#include "nar-info.hh"
|
||||
#include "finally.hh"
|
||||
#include "signals.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
@ -217,6 +218,8 @@ void PathSubstitutionGoal::tryToRun()
|
||||
|
||||
thr = std::thread([this]() {
|
||||
try {
|
||||
ReceiveInterrupts receiveInterrupts;
|
||||
|
||||
/* Wake up the worker loop when we're done. */
|
||||
Finally updateStats([this]() { outPipe.writeSide.close(); });
|
||||
|
||||
|
@ -79,6 +79,8 @@ void ThreadPool::process()
|
||||
|
||||
void ThreadPool::doWork(bool mainThread)
|
||||
{
|
||||
ReceiveInterrupts receiveInterrupts;
|
||||
|
||||
if (!mainThread)
|
||||
interruptCheck = [&]() { return (bool) quit; };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user