Austin Harris has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/50710 )

Change subject: sim: Fix hang while terminating threads with fork
......................................................................

sim: Fix hang while terminating threads with fork

It is possible that gem5 is forked multiple times before the threads are
re-created, so don't wait for the barrier if the threads were already
terminated.

Change-Id: Ia04db2f3b1341c4d432178a37812fd882e148ec2
---
M src/sim/simulate.cc
1 file changed, 2 insertions(+), 0 deletions(-)



diff --git a/src/sim/simulate.cc b/src/sim/simulate.cc
index ec46cbf..c5d0794 100644
--- a/src/sim/simulate.cc
+++ b/src/sim/simulate.cc
@@ -118,6 +118,8 @@
     terminateThreads()
     {
         assert(!terminate);
+        if (threads.empty())
+            return;

         /* This function should only be called when the simulator is
          * handling a global exit event (typically from Python). This

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/50710
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ia04db2f3b1341c4d432178a37812fd882e148ec2
Gerrit-Change-Number: 50710
Gerrit-PatchSet: 1
Gerrit-Owner: Austin Harris <m...@austin-harris.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to