From 04e73b9b9a4ade8326c5e1f326c5b8c547b2948e Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 12 Jun 2008 22:34:33 +0000 Subject: process counter now serialized too. --- sources/core/VSProcess.java | 3 ++- sources/simulator/VSSimulatorCanvas.java | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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(); + this.processNum = processNum; this.prefs = prefs; this.simulatorCanvas = simulatorCanvas; this.logging = logging; - tasks = new VSPriorityQueue(); processID = simulatorCanvas.processIDCount(); random = new VSRandom(processID*processNum+processID+processNum); + tasks = new VSPriorityQueue(); 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(); -- cgit v1.2.3