#8 wrap Shell in a dedicated Thread

This commit is contained in:
Rasha Djurdjevic 2021-01-06 16:39:11 +01:00
parent c86aaccfba
commit 95c2d445a7

View File

@ -26,6 +26,7 @@ public class Nameserver implements INameserver {
private NameServerRemote nameServerLocal; private NameServerRemote nameServerLocal;
private Shell shell; private Shell shell;
private Thread shellThread;
/** /**
* Creates a new server instance. * Creates a new server instance.
@ -80,11 +81,12 @@ public class Nameserver implements INameserver {
this.shutdown(); this.shutdown();
throw new StopShellException(); throw new StopShellException();
}))); })));
shellThread = new Thread(shell);
} }
@Override @Override
public void run() { public void run() {
shell.run(); shellThread.start();
} }
@Override @Override