summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdul Mutaal Ahmad <abdul.mutaal@gmail.com>2015-09-15 08:14:07 -0500
committerAbdul Mutaal Ahmad <abdul.mutaal@gmail.com>2015-09-15 08:14:07 -0500
commit8dfa45e03cded21e071bb6e652ad9a8d9e0ef7b4 (patch)
tree37e388eeca6be18dfc8e75a6137f2b6e8c6ffe47
parent1bb6a100ab92c52259fcf12feb1e5c02f46b3fdd (diff)
downloadgem5-8dfa45e03cded21e071bb6e652ad9a8d9e0ef7b4.tar.xz
misc: Bugfix for Freezing Terminal in SystemC Simulation
If the terminal was used in the SystemC or TLM simulations the simulation gets in a deadlock state. This is because of the Event queue gets locked while servicing the async events leading to event queue deadlock. This was solved by locking the queue at the beginning of service of async events. Committed by: Nilay Vaish <nilay@cs.wisc.edu>
-rw-r--r--util/systemc/sc_module.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/util/systemc/sc_module.cc b/util/systemc/sc_module.cc
index a47df8194..71b3b5fbb 100644
--- a/util/systemc/sc_module.cc
+++ b/util/systemc/sc_module.cc
@@ -140,6 +140,7 @@ void
Module::serviceAsyncEvent()
{
EventQueue *eventq = getEventQueue(0);
+ std::lock_guard<EventQueue> lock(*eventq);
assert(async_event);