summaryrefslogtreecommitdiff
path: root/sources/core
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-06-03 14:57:27 +0000
committerPaul Buetow <paul@buetow.org>2008-06-03 14:57:27 +0000
commitf7bdf8a7f6ebd43bfacc22eeeda3eb52bf50efd7 (patch)
tree38dba43c074d10466d206cdc07015b3e65735a9e /sources/core
parentb65cb84037cec3185aeed8b996455f8e97c17216 (diff)
Bugfixes:
VSTaskManager.getGlobalTask did not return all global tasks. Extra check if a protocol has been initialized.
Diffstat (limited to 'sources/core')
-rw-r--r--sources/core/VSTaskManager.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/sources/core/VSTaskManager.java b/sources/core/VSTaskManager.java
index 5e32183..272a52c 100644
--- a/sources/core/VSTaskManager.java
+++ b/sources/core/VSTaskManager.java
@@ -268,7 +268,7 @@ public class VSTaskManager implements VSSerializable {
*
* @param task the task to insert
*/
- private void insert(VSTask task) {
+ private synchronized void insert(VSTask task) {
if (task.timeOver()) {
if (task.isProgrammed())
fullfilledProgrammedTasks.addLast(task);
@@ -286,7 +286,7 @@ public class VSTaskManager implements VSSerializable {
*
* @param task the task to add
*/
- public void addTask(VSTask task) {
+ public synchronized void addTask(VSTask task) {
addTask(task, VSTaskManager.ONLY_ONCE);
}
@@ -328,7 +328,7 @@ public class VSTaskManager implements VSSerializable {
*
* @param tasks the tasks to remove
*/
- public void removeAllTasks(ArrayList<VSTask> tasks) {
+ public synchronized void removeAllTasks(ArrayList<VSTask> tasks) {
for (VSTask task : tasks)
removeTask(task);
}
@@ -396,7 +396,7 @@ public class VSTaskManager implements VSSerializable {
if (task.isGlobalTimed())
globalTasks.add(task);
- for (VSTask task : globalTasks)
+ for (VSTask task : this.globalTasks)
if (task.isProgrammed())
globalTasks.add(task);
@@ -453,7 +453,7 @@ public class VSTaskManager implements VSSerializable {
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
- public String toString() {
+ public synchronized String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append(prefs.getString("lang.task.manager"));
@@ -467,6 +467,7 @@ public class VSTaskManager implements VSSerializable {
}
buffer.append(prefs.getString("lang.tasks.global"));
+ buffer.append(": ");
for (VSTask task : globalTasks) {
buffer.append(task);
@@ -474,6 +475,7 @@ public class VSTaskManager implements VSSerializable {
}
buffer.append(prefs.getString("lang.tasks.local"));
+ buffer.append(": ");
ArrayList<VSProcess> processes = simulatorCanvas.getProcesses();
synchronized (processes) {