Put lock in a more strategic location

This commit is contained in:
ME1312 2021-02-24 17:13:26 -05:00
parent f90a54e636
commit 2beec3ae7a
No known key found for this signature in database
GPG Key ID: FEFFE2F698E88FA8
1 changed files with 2 additions and 1 deletions

View File

@ -137,7 +137,6 @@ public class InternalSubServer extends SubServerImpl {
}
private void run() {
lock = false;
allowrestart = true;
started = false;
try {
@ -151,6 +150,7 @@ public class InternalSubServer extends SubServerImpl {
Logger.get("SubServers").info("Now starting " + getName());
logger.process = process;
logger.start();
lock = false;
command = new BufferedWriter(new OutputStreamWriter(process.getOutputStream()));
for (LoggedCommand command : history) if (process.isAlive()) {
this.command.write(command.getCommand());
@ -162,6 +162,7 @@ public class InternalSubServer extends SubServerImpl {
} catch (IOException | InterruptedException e) {
e.printStackTrace();
allowrestart = false;
lock = false;
}
Logger.get("SubServers").info(getName() + " has stopped");