Skip to content

Commit 7cd17b4

Browse files
committed
Give names to ChannelPump threads
1 parent 94769c6 commit 7cd17b4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/ProcessWrapper.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,23 +79,23 @@ public ProcessWrapper(Process process, boolean pipeStdin, boolean pipeStdout, bo
7979
this.process = process;
8080
if (pipeStdin) {
8181
inPipe = Pipe.open();
82-
inThread = new ChannelPump(inPipe.source(), Channels.newChannel(process.getOutputStream()));
82+
inThread = new ChannelPump("stdin", inPipe.source(), Channels.newChannel(process.getOutputStream()));
8383
inThread.start();
8484
} else {
8585
inPipe = null;
8686
inThread = null;
8787
}
8888
if (pipeStdout) {
8989
outPipe = Pipe.open();
90-
outThread = new ChannelPump(Channels.newChannel(process.getInputStream()), outPipe.sink());
90+
outThread = new ChannelPump("stdout", Channels.newChannel(process.getInputStream()), outPipe.sink());
9191
outThread.start();
9292
} else {
9393
outPipe = null;
9494
outThread = null;
9595
}
9696
if (pipeStderr) {
9797
errPipe = Pipe.open();
98-
errThread = new ChannelPump(Channels.newChannel(process.getErrorStream()), errPipe.sink());
98+
errThread = new ChannelPump("stderr", Channels.newChannel(process.getErrorStream()), errPipe.sink());
9999
errThread.start();
100100
} else {
101101
errPipe = null;
@@ -175,7 +175,8 @@ static class ChannelPump extends Thread {
175175
private final ReadableByteChannel source;
176176
private final WritableByteChannel sink;
177177

178-
ChannelPump(ReadableByteChannel source, WritableByteChannel sink) {
178+
ChannelPump(String streamName, ReadableByteChannel source, WritableByteChannel sink) {
179+
super("ChannelPump-" + streamName);
179180
this.source = source;
180181
this.sink = sink;
181182
}

0 commit comments

Comments
 (0)