diff options
| author | Paul Buetow <paul@buetow.org> | 2008-06-12 22:34:33 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2008-06-12 22:34:33 +0000 |
| commit | 04e73b9b9a4ade8326c5e1f326c5b8c547b2948e (patch) | |
| tree | 0a78f45afb1f910bb6b45c5ab5227f59ec5354ef /sources | |
| parent | 6091b415053e5bd8f50ea282e6dddc67ac3c2c12 (diff) | |
process counter now serialized too.
Diffstat (limited to 'sources')
| -rw-r--r-- | sources/core/VSProcess.java | 3 | ||||
| -rw-r--r-- | sources/simulator/VSSimulatorCanvas.java | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/sources/core/VSProcess.java b/sources/core/VSProcess.java index 9842321..03b03e5 100644 --- a/sources/core/VSProcess.java +++ b/sources/core/VSProcess.java @@ -216,14 +216,15 @@ public class VSProcess extends VSPrefs implements VSSerializable { /* May be not null if called from deserialization */ if (this.protocolsToReset == null) this.protocolsToReset = new ArrayList<VSAbstractProtocol>(); + this.processNum = processNum; this.prefs = prefs; this.simulatorCanvas = simulatorCanvas; this.logging = logging; - tasks = new VSPriorityQueue<VSTask>(); processID = simulatorCanvas.processIDCount(); random = new VSRandom(processID*processNum+processID+processNum); + tasks = new VSPriorityQueue<VSTask>(); initTimeFormats(); diff --git a/sources/simulator/VSSimulatorCanvas.java b/sources/simulator/VSSimulatorCanvas.java index 92247c9..c28be85 100644 --- a/sources/simulator/VSSimulatorCanvas.java +++ b/sources/simulator/VSSimulatorCanvas.java @@ -1627,6 +1627,8 @@ public class VSSimulatorCanvas extends Canvas /** For later backwards compatibility, to add more stuff */ objectOutputStream.writeObject(new Boolean(false)); + objectOutputStream.writeObject(new Integer(processCounter)); + synchronized (processes) { objectOutputStream.writeObject(new Integer(numProcesses)); for (VSProcess process : processes) @@ -1653,6 +1655,8 @@ public class VSSimulatorCanvas extends Canvas /** For later backwards compatibility, to add more stuff */ objectInputStream.readObject(); + processCounter = ((Integer) objectInputStream.readObject()).intValue(); + int num = ((Integer) objectInputStream.readObject()).intValue(); logging.clear(); |
