From 222d028fac58233a451e2de875353252a3dc9f63 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 24 May 2008 21:06:15 +0000 Subject: PRocesses now get removed properly. Removed all VSSimulation* classes. --- sources/core/VSTaskManager.java | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'sources/core/VSTaskManager.java') diff --git a/sources/core/VSTaskManager.java b/sources/core/VSTaskManager.java index 66913fc..6b419cf 100644 --- a/sources/core/VSTaskManager.java +++ b/sources/core/VSTaskManager.java @@ -216,6 +216,29 @@ public class VSTaskManager { return false; } + public synchronized void removeTasksOf(VSProcess process) { + ArrayList removeThose = new ArrayList(); + for (VSTask task : fullfilledProgrammedTasks) + if (task.isProcess(process)) + removeThose.add(task); + for (VSTask task : removeThose) + fullfilledProgrammedTasks.remove(task); + + removeThose.clear(); + for (VSTask task : globalTasks) + if (task.isProcess(process)) + removeThose.add(task); + for (VSTask task : removeThose) + globalTasks.remove(task); + + removeThose.clear(); + for (VSTask task : tasks) + if (task.isProcess(process)) + removeThose.add(task); + for (VSTask task : removeThose) + tasks.remove(task); + } + public synchronized VSPriorityQueue getLocalTasks() { VSPriorityQueue processTasks = new VSPriorityQueue(); -- cgit v1.2.3