From fd62105a9d2a33af95db01330c1cbcc87d3811fd Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Fri, 26 Jun 2015 13:37:06 +0200 Subject: [PATCH] replaced unused map with list --- src/utils/workqueue.h | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/utils/workqueue.h b/src/utils/workqueue.h index 7e036fdd..c1b2d09b 100644 --- a/src/utils/workqueue.h +++ b/src/utils/workqueue.h @@ -22,21 +22,11 @@ #include #include -#include "unordered_defs.h" -using std::queue; -using std::string; +#include #include "debuglog.h" #include "ptmutex.h" -/// Store per-worker-thread data. Just an initialized timespec, and -/// used at the moment. -class WQTData { - public: - WQTData() {wstart.tv_sec = 0; wstart.tv_nsec = 0;} - struct timespec wstart; -}; - /** * A WorkQueue manages the synchronisation around a queue of work items, * where a number of client threads queue tasks and a number of worker @@ -94,7 +84,7 @@ public: m_name.c_str(), err)); return false; } - m_worker_threads.insert(pair(thr, WQTData())); + m_worker_threads.push_back(thr); } return true; } @@ -213,11 +203,11 @@ public: // Perform the thread joins and compute overall status // Workers return (void*)1 if ok void *statusall = (void*)1; - STD_UNORDERED_MAP::iterator it; + std::list::iterator it; while (!m_worker_threads.empty()) { void *status; it = m_worker_threads.begin(); - pthread_join(it->first, &status); + pthread_join(*it, &status); if (status == (void *)0) statusall = status; m_worker_threads.erase(it); @@ -330,7 +320,7 @@ private: // Per-thread data. The data is not used currently, this could be // a set - STD_UNORDERED_MAP m_worker_threads; + std::list m_worker_threads; // Synchronization queue m_queue;