summaryrefslogtreecommitdiff
path: root/src/systemc/core/process.cc
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2018-10-06 02:58:02 -0700
committerGabe Black <gabeblack@google.com>2018-10-16 01:02:06 +0000
commita7d99be947c80de4647d07fd4f73c19cc4050a77 (patch)
treeb59d98011d72ebc847ce5f73cbf2063f1f7cac13 /src/systemc/core/process.cc
parent9677f2da711edc3382e754c7dfd62464e904a9e9 (diff)
downloadgem5-a7d99be947c80de4647d07fd4f73c19cc4050a77.tar.xz
systemc: Remove a redundant injectException for Thread's throw_it.
For some reason lost to the sands of time, the throw_it function was virtual for the Thread class, and that class would call the base class's throw_it, and then also injectException itself. That would result in the exception being injected into the thread twice which is incorrect. Since it's not clear what the original intention of this code was, the throw_it function is now no longer virtual, and the one useful aspect of it, a check if the process is already terminated, was moved into the base class function. Change-Id: I7fb14baa7728bd1e9206011870b6ccaa9c4e8c64 Reviewed-on: https://gem5-review.googlesource.com/c/13312 Reviewed-by: Gabe Black <gabeblack@google.com> Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/core/process.cc')
-rw-r--r--src/systemc/core/process.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/systemc/core/process.cc b/src/systemc/core/process.cc
index 3bf7ead07..93542fc00 100644
--- a/src/systemc/core/process.cc
+++ b/src/systemc/core/process.cc
@@ -206,9 +206,10 @@ Process::throw_it(ExceptionWrapperBase &exc, bool inc_kids)
if (inc_kids)
forEachKid([&exc](Process *p) { p->throw_it(exc, true); });
- // Only inject an exception into threads that have started.
- if (!_needsStart)
- injectException(exc);
+ if (_needsStart || _terminated)
+ return;
+
+ injectException(exc);
}
void