diff options
| author | Paul Buetow <paul@buetow.org> | 2008-05-19 09:34:17 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-05-19 09:34:17 +0000 |
| commit | 5eb35a6da1ba939878c0351f35b4019fd406ffdd (patch) | |
| tree | d74636167291a21b5694eee3fd5f5564d1075424 /sources/core | |
| parent | 6dec65db5dceaf8636a98f5bd51c31e20922ecdd (diff) | |
TaskManager bugfix.
Diffstat (limited to 'sources/core')
| -rw-r--r-- | sources/core/VSTask.java | 28 | ||||
| -rw-r--r-- | sources/core/VSTaskManager.java | 14 |
2 files changed, 21 insertions, 21 deletions
diff --git a/sources/core/VSTask.java b/sources/core/VSTask.java index 7c2b067..89c61fb 100644 --- a/sources/core/VSTask.java +++ b/sources/core/VSTask.java @@ -47,12 +47,12 @@ public class VSTask implements Comparable { return false; } - public boolean timeOver() { - if (isGlobalTimed) - return taskTime < process.getGlobalTime(); + public boolean timeOver() { + if (isGlobalTimed) + return taskTime < process.getGlobalTime(); - return taskTime < process.getTime(); - } + return taskTime < process.getTime(); + } public boolean equals(VSTask task) { return event.equals(task.getEvent()) @@ -183,18 +183,18 @@ public class VSTask implements Comparable { else if (taskTime > task.getTaskTime()) return 1; - /* If it's a ProtocolEvent, it should get handled first */ - boolean a = event instanceof ProtocolEvent; - boolean b = task.getEvent() instanceof ProtocolEvent; + /* If it's a ProtocolEvent, it should get handled first */ + boolean a = event instanceof ProtocolEvent; + boolean b = task.getEvent() instanceof ProtocolEvent; - if (a && b) - return 0; + if (a && b) + return 0; - if (a) - return -1; + if (a) + return -1; - if (b) - return 1; + if (b) + return 1; } return 0; diff --git a/sources/core/VSTaskManager.java b/sources/core/VSTaskManager.java index 1857865..e5adfac 100644 --- a/sources/core/VSTaskManager.java +++ b/sources/core/VSTaskManager.java @@ -22,7 +22,7 @@ public class VSTaskManager { this.fullfilledProgrammedTasks = new LinkedList<VSTask>(); } - /* + /* private Comparator<VSTask> createComparator() { return new Comparator<VSTask>() { public int compare(VSTask a, VSTask b) { @@ -36,7 +36,7 @@ public class VSTaskManager { } }; } - */ + */ public synchronized void runTasks(final long step, final long offset, final long lastGlobalTime) { VSTask task = null; @@ -184,10 +184,10 @@ public class VSTaskManager { } private void insert(VSTask task) { - if (task.timeOver()) - fullfilledProgrammedTasks.addLast(task); + if (task.timeOver()) + fullfilledProgrammedTasks.addLast(task); - else if (task.isGlobalTimed()) + else if (task.isGlobalTimed()) globalTasks.add(task); else @@ -216,7 +216,7 @@ public class VSTaskManager { return false; } - /* + /* public synchronized LinkedList<VSTask> getProtocolTasks(VSProtocol protocol) { LinkedList<VSTask> protocolTasks = new LinkedList<VSTask>(); @@ -278,7 +278,7 @@ public class VSTaskManager { insert(task); } } -*/ + */ public synchronized VSPriorityQueue<VSTask> getLocalTasks() { VSPriorityQueue<VSTask> processTasks = new VSPriorityQueue<VSTask>(); |
