Commit 179b56a6 authored by Daniel Le Berre's avatar Daniel Le Berre

Add volatile for ExitCode in LauncherMode.

parent 171059c7
Pipeline #202 passed with stage
in 11 minutes and 23 seconds
......@@ -47,7 +47,7 @@ import org.sat4j.tools.Backbone;
*
*/
final class DecisionMode implements ILauncherMode {
private ExitCode exitCode = ExitCode.UNKNOWN;
private volatile ExitCode exitCode = ExitCode.UNKNOWN;
private int nbSolutionFound;
private PrintWriter out;
private long beginTime;
......
......@@ -52,7 +52,7 @@ import org.sat4j.tools.LexicoDecorator;
*/
final class OptimizationMode implements ILauncherMode {
private int nbSolutions;
private ExitCode exitCode = ExitCode.UNKNOWN;
private volatile ExitCode exitCode = ExitCode.UNKNOWN;
private boolean isIncomplete = false;
private PrintWriter out;
private long beginTime;
......@@ -62,8 +62,8 @@ final class OptimizationMode implements ILauncherMode {
this.isIncomplete = isIncomplete;
}
public void displayResult(ISolver solver, IProblem problem,
ILogAble logger, PrintWriter out, Reader reader, long beginTime,
public void displayResult(ISolver solver, IProblem problem, ILogAble logger,
PrintWriter out, Reader reader, long beginTime,
boolean displaySolutionLine) {
if (solver == null) {
return;
......@@ -73,8 +73,8 @@ final class OptimizationMode implements ILauncherMode {
solver.printStat(out);
out.println(ANSWER_PREFIX + exitCode);
if (exitCode == ExitCode.SATISFIABLE
|| exitCode == ExitCode.OPTIMUM_FOUND || isIncomplete
&& exitCode == ExitCode.UPPER_BOUND) {
|| exitCode == ExitCode.OPTIMUM_FOUND
|| isIncomplete && exitCode == ExitCode.UPPER_BOUND) {
assert this.nbSolutions > 0;
logger.log("Found " + this.nbSolutions + " solution(s)");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment