systemc: Ensure the terminated event is notified in all cases.
authorGabe Black <gabeblack@google.com>
Fri, 27 Jul 2018 23:28:50 +0000 (16:28 -0700)
committerGabe Black <gabeblack@google.com>
Tue, 11 Sep 2018 21:52:52 +0000 (21:52 +0000)
The terminated event was being notified if a process was killed, but
not if it was terminated in other ways. This change moves the
notification into the helper which sets termination related state.

Change-Id: I10aa5ad25875db992c8408dc60f087efc76b336b
Reviewed-on: https://gem5-review.googlesource.com/12057
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

src/systemc/core/process.cc

index a54d5c24c18d1380770c576c96e659657c98435c..ef1cea61a1a386cffae9e6500600c2d72d274d90 100644 (file)
@@ -220,8 +220,6 @@ Process::kill(bool inc_kids)
     // Inject the kill exception into this process if it's started.
     if (!_needsStart)
         injectException(killException);
-
-    _terminatedEvent.notify();
 }
 
 void
@@ -384,6 +382,8 @@ Process::terminate()
     for (auto s: staticSensitivities)
         delete s;
     staticSensitivities.clear();
+
+    _terminatedEvent.notify();
 }
 
 Process *Process::_newest;