mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-28 21:26:01 +01:00
Put lock in a more strategic location
This commit is contained in:
parent
f90a54e636
commit
2beec3ae7a
@ -137,7 +137,6 @@ public class InternalSubServer extends SubServerImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void run() {
|
private void run() {
|
||||||
lock = false;
|
|
||||||
allowrestart = true;
|
allowrestart = true;
|
||||||
started = false;
|
started = false;
|
||||||
try {
|
try {
|
||||||
@ -151,6 +150,7 @@ public class InternalSubServer extends SubServerImpl {
|
|||||||
Logger.get("SubServers").info("Now starting " + getName());
|
Logger.get("SubServers").info("Now starting " + getName());
|
||||||
logger.process = process;
|
logger.process = process;
|
||||||
logger.start();
|
logger.start();
|
||||||
|
lock = false;
|
||||||
command = new BufferedWriter(new OutputStreamWriter(process.getOutputStream()));
|
command = new BufferedWriter(new OutputStreamWriter(process.getOutputStream()));
|
||||||
for (LoggedCommand command : history) if (process.isAlive()) {
|
for (LoggedCommand command : history) if (process.isAlive()) {
|
||||||
this.command.write(command.getCommand());
|
this.command.write(command.getCommand());
|
||||||
@ -162,6 +162,7 @@ public class InternalSubServer extends SubServerImpl {
|
|||||||
} catch (IOException | InterruptedException e) {
|
} catch (IOException | InterruptedException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
allowrestart = false;
|
allowrestart = false;
|
||||||
|
lock = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.get("SubServers").info(getName() + " has stopped");
|
Logger.get("SubServers").info(getName() + " has stopped");
|
||||||
|
Loading…
Reference in New Issue
Block a user