diff --git a/src/cosim/execution.cpp b/src/cosim/execution.cpp index 0eafe34f..71dbd623 100644 --- a/src/cosim/execution.cpp +++ b/src/cosim/execution.cpp @@ -152,7 +152,9 @@ class execution::impl stepSize = step(); timer_.sleep(currentTime_); } while (!stopped_ && !timed_out(endTime, currentTime_, stepSize)); - return !stopped_; + bool isStopped = stopped_; + stopped_ = true; + return !isStopped; }); }