From 152aad00c5d2a4261767d295bc49a9f9006e4691 Mon Sep 17 00:00:00 2001 From: MAGSTE Date: Thu, 9 Sep 2021 09:53:35 +0200 Subject: [PATCH 1/2] Stopped flag is now set true after simulate_until loop is finished --- src/cosim/execution.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cosim/execution.cpp b/src/cosim/execution.cpp index 0eafe34f2..a455e07a7 100644 --- a/src/cosim/execution.cpp +++ b/src/cosim/execution.cpp @@ -151,8 +151,10 @@ class execution::impl do { stepSize = step(); timer_.sleep(currentTime_); - } while (!stopped_ && !timed_out(endTime, currentTime_, stepSize)); - return !stopped_; + } while (!stopped_ && !timed_out(endTime, currentTime_, stepSize)); + bool isStopped = stopped_; + stopped_ = true; + return !isStopped; }); } From 4981b659501fe0871551e8164ed52465cfb1a29c Mon Sep 17 00:00:00 2001 From: msteinsto Date: Mon, 13 Sep 2021 10:11:01 +0200 Subject: [PATCH 2/2] Removed unnecessary space --- src/cosim/execution.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cosim/execution.cpp b/src/cosim/execution.cpp index a455e07a7..71dbd6232 100644 --- a/src/cosim/execution.cpp +++ b/src/cosim/execution.cpp @@ -151,7 +151,7 @@ class execution::impl do { stepSize = step(); timer_.sleep(currentTime_); - } while (!stopped_ && !timed_out(endTime, currentTime_, stepSize)); + } while (!stopped_ && !timed_out(endTime, currentTime_, stepSize)); bool isStopped = stopped_; stopped_ = true; return !isStopped;