Added a wait for application closing before closing of manager

Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
Emmanuel Bigeon 2016-12-21 16:37:24 -05:00
parent 6d496d701d
commit ab47d6573b

View File

@ -237,6 +237,14 @@ public class SocketConsoleApplicationShell implements Runnable, AutoCloseable {
runnable.setRunning(false); runnable.setRunning(false);
try { try {
consoleManager.type(applicationShutdown); consoleManager.type(applicationShutdown);
try {
appThNext.join(ONE_TENTH_OF_SECOND);
} catch (InterruptedException e) {
LOGGER.warning("Application thread was interrupted!"); //$NON-NLS-1$
LOGGER.log(Level.FINE,
"Application thread was interrupted while closing", //$NON-NLS-1$
e);
}
consoleManager.close(); consoleManager.close();
} catch (IOException e) { } catch (IOException e) {
LOGGER.warning("Unable to close application correctly"); //$NON-NLS-1$ LOGGER.warning("Unable to close application correctly"); //$NON-NLS-1$