Skip to content

Commit

Permalink
FELIX-6046 - fix gogo shell thread interrupt.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1853016 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
tjwatson committed Feb 5, 2019
1 parent 397478a commit cbf47ba
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ private static class StartShellJob implements Runnable
private final BundleContext context;
private final CommandProcessor processor;
private volatile CommandSession session;
private volatile Thread shellThread;


public StartShellJob(BundleContext context, CommandProcessor processor)
{
Expand All @@ -195,6 +197,7 @@ public StartShellJob(BundleContext context, CommandProcessor processor)
public void run()
{

shellThread = Thread.currentThread();
session = processor.createSession(new FileInputStream(FileDescriptor.in),
new FileOutputStream(FileDescriptor.out),
new FileOutputStream(FileDescriptor.err));
Expand Down Expand Up @@ -239,7 +242,9 @@ public void terminate()
session.close();
session = null;
}
Thread.currentThread().interrupt();
if (shellThread != null) {
shellThread.interrupt();
}
}
}
}

0 comments on commit cbf47ba

Please sign in to comment.