diff options
author | Andreas Hansson <andreas.hansson@arm.com> | 2014-09-27 09:08:29 -0400 |
---|---|---|
committer | Andreas Hansson <andreas.hansson@arm.com> | 2014-09-27 09:08:29 -0400 |
commit | de62aedabc96e7492c40bbc4468ba42b3274bfd6 (patch) | |
tree | e68dae6dd1f3da0e7d2dcf3e946728c46e63bbce /src/sim/eventq.cc | |
parent | 71d5f03175b3a684b94bbc515ebc02e2b493b7cf (diff) | |
download | gem5-de62aedabc96e7492c40bbc4468ba42b3274bfd6.tar.xz |
misc: Fix a bunch of minor issues identified by static analysis
Add some missing initialisation, and fix a handful benign resource
leaks (including some false positives).
Diffstat (limited to 'src/sim/eventq.cc')
-rw-r--r-- | src/sim/eventq.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/sim/eventq.cc b/src/sim/eventq.cc index b8e45a13e..4fde79656 100644 --- a/src/sim/eventq.cc +++ b/src/sim/eventq.cc @@ -460,29 +460,28 @@ Event::dump() const } EventQueue::EventQueue(const string &n) - : objName(n), head(NULL), _curTick(0), - async_queue_mutex(new std::mutex()) + : objName(n), head(NULL), _curTick(0) { } void EventQueue::asyncInsert(Event *event) { - async_queue_mutex->lock(); + async_queue_mutex.lock(); async_queue.push_back(event); - async_queue_mutex->unlock(); + async_queue_mutex.unlock(); } void EventQueue::handleAsyncInsertions() { assert(this == curEventQueue()); - async_queue_mutex->lock(); + async_queue_mutex.lock(); while (!async_queue.empty()) { insert(async_queue.front()); async_queue.pop_front(); } - async_queue_mutex->unlock(); + async_queue_mutex.unlock(); } |