From 87adbcb3d5d5791715acba3b0304c818f167b634 Mon Sep 17 00:00:00 2001 From: Fredrik Osterlind Date: Tue, 22 Feb 2011 20:31:04 +0100 Subject: [PATCH] handle pending simulation thread events before simulation starts, just after loading --- tools/cooja/java/se/sics/cooja/Simulation.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/cooja/java/se/sics/cooja/Simulation.java b/tools/cooja/java/se/sics/cooja/Simulation.java index 0fbe1297f..6cad2a24b 100644 --- a/tools/cooja/java/se/sics/cooja/Simulation.java +++ b/tools/cooja/java/se/sics/cooja/Simulation.java @@ -685,6 +685,12 @@ public class Simulation extends Observable implements Runnable { setChanged(); notifyObservers(this); + + /* Execute simulation thread events now, before simulation starts */ + while (hasPollRequests) { + popSimulationInvokes().run(); + } + return true; }