From 500b15abeb493bc40b77b964aba1eb0186d79b9e Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 19 May 2008 03:38:05 +0000 Subject: TaskManager improvements. --- sources/core/VSTaskManager.java | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'sources/core/VSTaskManager.java') diff --git a/sources/core/VSTaskManager.java b/sources/core/VSTaskManager.java index 4f79d16..1857865 100644 --- a/sources/core/VSTaskManager.java +++ b/sources/core/VSTaskManager.java @@ -216,6 +216,7 @@ public class VSTaskManager { return false; } + /* public synchronized LinkedList getProtocolTasks(VSProtocol protocol) { LinkedList protocolTasks = new LinkedList(); @@ -277,6 +278,34 @@ public class VSTaskManager { insert(task); } } +*/ + public synchronized VSPriorityQueue getLocalTasks() { + VSPriorityQueue processTasks = new VSPriorityQueue(); + + for (VSTask task : fullfilledProgrammedTasks) + if (!task.isGlobalTimed() && task.isProgrammed()) + processTasks.add(task); + + for (VSTask task : tasks) + if (task.isProgrammed()) + processTasks.add(task); + + return processTasks; + } + + public synchronized VSPriorityQueue getGlobalTasks() { + VSPriorityQueue processTasks = new VSPriorityQueue(); + + for (VSTask task : fullfilledProgrammedTasks) + if (task.isGlobalTimed() && task.isProgrammed()) + processTasks.add(task); + + for (VSTask task : globalTasks) + if (task.isProgrammed()) + processTasks.add(task); + + return processTasks; + } public synchronized VSPriorityQueue getProcessLocalTasks(VSProcess process) { VSPriorityQueue processTasks = new VSPriorityQueue(); -- cgit v1.2.3