extracted clock_gettime in order to support MACH architecture

This commit is contained in:
john30
2015-11-07 11:56:39 +01:00
parent b4f89ab5dc
commit 0045d1cec4
6 changed files with 89 additions and 4 deletions
+2 -1
View File
@@ -23,6 +23,7 @@
#include <list>
#include <pthread.h>
#include <errno.h>
#include "clock.h"
/** \file queue.h */
@@ -88,7 +89,7 @@ public:
pthread_mutex_lock(&m_mutex);
if (timeout>0) {
struct timespec t;
clock_gettime(CLOCK_REALTIME, &t);
clockGettime(&t);
t.tv_sec += timeout;
while (m_queue.empty()) {
if (pthread_cond_timedwait(&m_cond, &m_mutex, &t)==ETIMEDOUT)