diff options
-rw-r--r-- | src/systemc/core/SConscript | 1 | ||||
-rw-r--r-- | src/systemc/core/process.cc | 7 | ||||
-rw-r--r-- | src/systemc/core/process.hh | 2 | ||||
-rw-r--r-- | src/systemc/core/process_types.cc | 46 | ||||
-rw-r--r-- | src/systemc/core/process_types.hh | 2 |
5 files changed, 5 insertions, 53 deletions
diff --git a/src/systemc/core/SConscript b/src/systemc/core/SConscript index 230304214..0ce10290d 100644 --- a/src/systemc/core/SConscript +++ b/src/systemc/core/SConscript @@ -37,7 +37,6 @@ if env['USE_SYSTEMC']: Source('object.cc') Source('port.cc') Source('process.cc') - Source('process_types.cc') Source('python.cc') Source('scheduler.cc') Source('sched_event.cc') 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 diff --git a/src/systemc/core/process.hh b/src/systemc/core/process.hh index 0331f0786..86ca6744e 100644 --- a/src/systemc/core/process.hh +++ b/src/systemc/core/process.hh @@ -84,7 +84,7 @@ class Process : public ::sc_core::sc_process_b, public ListNode void kill(bool inc_kids); void reset(bool inc_kids); - virtual void throw_it(ExceptionWrapperBase &exc, bool inc_kids); + void throw_it(ExceptionWrapperBase &exc, bool inc_kids); void injectException(ExceptionWrapperBase &exc); ExceptionWrapperBase *excWrapper; diff --git a/src/systemc/core/process_types.cc b/src/systemc/core/process_types.cc deleted file mode 100644 index 188225c02..000000000 --- a/src/systemc/core/process_types.cc +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2018 Google, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer; - * redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution; - * neither the name of the copyright holders nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * Authors: Gabe Black - */ - -#include "systemc/core/process_types.hh" - -namespace sc_gem5 -{ - -void -Thread::throw_it(ExceptionWrapperBase &exc, bool inc_kids) -{ - Process::throw_it(exc, inc_kids); - - if (_terminated) - return; - - injectException(exc); -} - -} // namespace sc_gem5 diff --git a/src/systemc/core/process_types.hh b/src/systemc/core/process_types.hh index 748c24914..1361e9745 100644 --- a/src/systemc/core/process_types.hh +++ b/src/systemc/core/process_types.hh @@ -63,8 +63,6 @@ class Thread : public Process const char *kind() const override { return "sc_thread_process"; } - void throw_it(ExceptionWrapperBase &exc, bool inc_kids) override; - sc_core::sc_curr_proc_kind procKind() const override { |