Conflicts:
	src/ebusloop.cpp
This commit is contained in:
john30
2014-10-23 22:29:10 +02:00
3 changed files with 9 additions and 5 deletions
+3
View File
@@ -1,6 +1,9 @@
ebusd - ChangeLog ebusd - ChangeLog
----------------- -----------------
2014-10-21 Roland Jax <roland.jax@liwest.at>
* class EBusLoop: recvBuffer removed.
2014-10-09 Roland Jax <roland.jax@liwest.at> 2014-10-09 Roland Jax <roland.jax@liwest.at>
* class BaseLoop, EBusLoop: polling functionality implemented. * class BaseLoop, EBusLoop: polling functionality implemented.
* Version changed from 0.3.0 to 0.4.0 * Version changed from 0.3.0 to 0.4.0
+1
View File
@@ -31,6 +31,7 @@ Dependency
---------- ----------
* libebus (https://github.com/yuhu-/libebus) * libebus (https://github.com/yuhu-/libebus)
* glibc * glibc
* pkgconfig
Build Build
+5 -5
View File
@@ -30,13 +30,13 @@ public:
WQueue() WQueue()
{ {
pthread_mutex_init(&m_mutex, NULL); pthread_mutex_init(&m_mutex, NULL);
pthread_cond_init(&m_condv, NULL); pthread_cond_init(&m_cond, NULL);
} }
~WQueue() ~WQueue()
{ {
pthread_mutex_destroy(&m_mutex); pthread_mutex_destroy(&m_mutex);
pthread_cond_destroy(&m_condv); pthread_cond_destroy(&m_cond);
} }
void add(T item) void add(T item)
@@ -45,7 +45,7 @@ public:
m_queue.push_back(item); m_queue.push_back(item);
pthread_cond_signal(&m_condv); pthread_cond_signal(&m_cond);
pthread_mutex_unlock(&m_mutex); pthread_mutex_unlock(&m_mutex);
} }
@@ -54,7 +54,7 @@ public:
pthread_mutex_lock(&m_mutex); pthread_mutex_lock(&m_mutex);
while (m_queue.size() == 0) while (m_queue.size() == 0)
pthread_cond_wait(&m_condv, &m_mutex); pthread_cond_wait(&m_cond, &m_mutex);
T item = m_queue.front(); T item = m_queue.front();
m_queue.pop_front(); m_queue.pop_front();
@@ -78,7 +78,7 @@ public:
private: private:
std::list<T> m_queue; std::list<T> m_queue;
pthread_mutex_t m_mutex; pthread_mutex_t m_mutex;
pthread_cond_t m_condv; pthread_cond_t m_cond;
}; };