forked from lix-project/lix
Merge pull request #9687 from edolstra/withFramedSink-ctrl-c-hang
withFramedSink(): Receive interrupts on the stderr thread (cherry picked from commit965cfe9688
) Change-Id:I8320a96957c01ec0e3450d1b3ae38a3baff78d49
This commit is contained in:
parent
137673de56
commit
8f5d0d4c05
|
@ -217,6 +217,8 @@ void PathSubstitutionGoal::tryToRun()
|
||||||
|
|
||||||
thr = std::thread([this]() {
|
thr = std::thread([this]() {
|
||||||
try {
|
try {
|
||||||
|
ReceiveInterrupts receiveInterrupts;
|
||||||
|
|
||||||
/* Wake up the worker loop when we're done. */
|
/* Wake up the worker loop when we're done. */
|
||||||
Finally updateStats([this]() { outPipe.writeSide.close(); });
|
Finally updateStats([this]() { outPipe.writeSide.close(); });
|
||||||
|
|
||||||
|
|
|
@ -1071,6 +1071,7 @@ void RemoteStore::ConnectionHandle::withFramedSink(std::function<void(Sink & sin
|
||||||
std::thread stderrThread([&]()
|
std::thread stderrThread([&]()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
ReceiveInterrupts receiveInterrupts;
|
||||||
processStderr(nullptr, nullptr, false);
|
processStderr(nullptr, nullptr, false);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
ex = std::current_exception();
|
ex = std::current_exception();
|
||||||
|
|
|
@ -77,6 +77,8 @@ void ThreadPool::process()
|
||||||
|
|
||||||
void ThreadPool::doWork(bool mainThread)
|
void ThreadPool::doWork(bool mainThread)
|
||||||
{
|
{
|
||||||
|
ReceiveInterrupts receiveInterrupts;
|
||||||
|
|
||||||
if (!mainThread)
|
if (!mainThread)
|
||||||
interruptCheck = [&]() { return (bool) quit; };
|
interruptCheck = [&]() { return (bool) quit; };
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue