Skip to content
Snippets Groups Projects
Commit 4f050ffc authored by Francesco's avatar Francesco
Browse files

multithreading for t-ui commands

parent d216e009
No related branches found
No related tags found
No related merge requests found
...@@ -239,21 +239,27 @@ public class MainManager { ...@@ -239,21 +239,27 @@ public class MainManager {
try { try {
Command command = CommandTuils.parse(input, info, false); Command command = CommandTuils.parse(input, info, false);
if (command != null) {
synchronized (returnValue) {
returnValue[0] = command != null;
returnValue.notify();
}
if (returnValue[0]) {
out.onOutput(command.exec(info), id); out.onOutput(command.exec(info), id);
returnValue[0] = true; }
} else
returnValue[0] = false;
} catch (Exception e) { } catch (Exception e) {
out.onOutput(e.toString(), id); out.onOutput(e.toString(), id);
} }
} }
}; };
t.run(); t.start();
t.join();
synchronized (returnValue) {
returnValue.wait();
return returnValue[0]; return returnValue[0];
} }
} }
} }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment