diff options
| author | Paul Buetow <paul@buetow.org> | 2008-06-11 09:48:10 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-06-11 09:48:10 +0000 |
| commit | 0e2e70d5a393024f3ae4a3a3560b4df51075000a (patch) | |
| tree | 27c659d282bec3508304d5fa80a34a1662185950 /sources/core/VSTaskManager.java | |
| parent | 412a1ac0e6311fe39452ae41b6eada4ef17cce34 (diff) | |
More javadoc.
Several bugfixes.
New feauture: Boolean: sim.periodic
A lot of more which i forgot!
Diffstat (limited to 'sources/core/VSTaskManager.java')
| -rw-r--r-- | sources/core/VSTaskManager.java | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/sources/core/VSTaskManager.java b/sources/core/VSTaskManager.java index d4ee83c..471b54f 100644 --- a/sources/core/VSTaskManager.java +++ b/sources/core/VSTaskManager.java @@ -32,10 +32,9 @@ import simulator.*; import utils.*; /** - * The class VSTaskManager. The task manager is responsible that all tasks - * will get fullfilled in the correct order. Please also read the javadoc - * of the VSTask class. It describes the difference between local and global - * timed tasks. + * The class VSTaskManager, it is responsible that all tasks will get + * fullfilled in the correct order. Please also read the javadoc of the VSTask + * class. It describes the difference between local and global timed tasks. * * @author Paul C. Buetow */ @@ -125,7 +124,7 @@ public class VSTaskManager implements VSSerializable { globalTasks.poll(); redo = true; - if (process.isCrashed() && !task.isProcessRecoverEvent()) { + if (process.isCrashed() && !task.hasProcessRecoverEvent()) { if (task.isProgrammed()) fullfilledProgrammedTasks.add(task); continue; @@ -186,7 +185,7 @@ public class VSTaskManager implements VSSerializable { redo = true; if (process.isCrashed() && - !task.isProcessRecoverEvent()) { + !task.hasProcessRecoverEvent()) { if (task.isProgrammed()) fullfilledProgrammedTasks.add(task); continue; @@ -506,28 +505,34 @@ public class VSTaskManager implements VSSerializable { /** For later backwards compatibility, to add more stuff */ objectOutputStream.writeObject(new Boolean(false)); - ArrayList<VSTask> tasks = new ArrayList<VSTask>(); + ArrayList<VSTask> serializeThoseTasks = new ArrayList<VSTask>(); - for (VSTask task : fullfilledProgrammedTasks) - tasks.add(task); + for (VSTask task : fullfilledProgrammedTasks) { + if (!task.hasNotSerializableEvent()) + serializeThoseTasks.add(task); + } - for (VSTask task : this.globalTasks) - tasks.add(task); + for (VSTask task : globalTasks) { + if (!task.hasNotSerializableEvent()) + serializeThoseTasks.add(task); + } ArrayList<VSProcess> processes = simulatorCanvas.getProcesses(); synchronized (processes) { for (VSProcess process : processes) { VSPriorityQueue<VSTask> localTasks = process.getTasks(); - ArrayList<VSTask> tasks_ = new ArrayList<VSTask>(); - for (VSTask task : localTasks) - tasks.add(task); + for (VSTask task : localTasks) { + if (!task.hasNotSerializableEvent()) + serializeThoseTasks.add(task); + } } } - objectOutputStream.writeObject(new Integer(tasks.size())); - for (VSTask task : tasks) - task.serialize(serialize, objectOutputStream); + objectOutputStream.writeObject( + new Integer(serializeThoseTasks.size())); + for (VSTask task : serializeThoseTasks) + task.serialize(serialize, objectOutputStream); /** For later backwards compatibility, to add more stuff */ objectOutputStream.writeObject(new Boolean(false)); |
