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
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50710
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Austin Harris
2021-09-21 01:36:06 -05:00
parent bec16fbc31
commit f42ce27065

View File

@@ -118,6 +118,8 @@ class SimulatorThreads
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