--- a/libupnpp/workqueue.hxx
+++ b/libupnpp/workqueue.hxx
@@ -23,13 +23,10 @@
#include <string>
#include <queue>
#include <unordered_map>
-#include <unordered_set>
-using std::unordered_map;
-using std::unordered_set;
-using std::queue;
-using std::string;
#include "ptmutex.hxx"
+
+namespace UPnPP {
/// Store per-worker-thread data. Just an initialized timespec, and
/// used at the moment.
@@ -61,7 +58,7 @@
* meaning no limit. hi == -1 means that the queue is disabled.
* @param lo minimum count of tasks before worker starts. Default 1.
*/
- WorkQueue(const string& name, size_t hi = 0, size_t lo = 1)
+ WorkQueue(const std::string& name, size_t hi = 0, size_t lo = 1)
: m_name(name), m_high(hi), m_low(lo),
m_workers_exited(0), m_clients_waiting(0), m_workers_waiting(0),
m_tottasks(0), m_nowake(0), m_workersleeps(0), m_clientsleeps(0)
@@ -203,7 +200,7 @@
// Perform the thread joins and compute overall status
// Workers return (void*)1 if ok
void *statusall = (void*)1;
- unordered_map<pthread_t, WQTData>::iterator it;
+ std::unordered_map<pthread_t, WQTData>::iterator it;
while (!m_worker_threads.empty()) {
void *status;
it = m_worker_threads.begin();
@@ -297,7 +294,7 @@
}
// Configuration
- string m_name;
+ std::string m_name;
size_t m_high;
size_t m_low;
@@ -308,10 +305,10 @@
// Per-thread data. The data is not used currently, this could be
// a set<pthread_t>
- unordered_map<pthread_t, WQTData> m_worker_threads;
+ std::unordered_map<pthread_t, WQTData> m_worker_threads;
// Synchronization
- queue<T> m_queue;
+ std::queue<T> m_queue;
pthread_cond_t m_ccond;
pthread_cond_t m_wcond;
PTMutexInit m_mutex;
@@ -326,4 +323,6 @@
unsigned int m_clientsleeps;
};
+} // namespace
+
#endif /* _WORKQUEUE_H_INCLUDED_ */