summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpierre lamot <pierre.lamot@openwide.fr>2015-01-21 12:04:37 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-02-05 16:38:06 +0100
commit8c56edbdf5311295a9ef3254d20d413389756425 (patch)
treeafd96c588d598caba7e4c93005d7b1f5eaa841f2
parent9ee7f46eb358bef952a2c0df3196c5d1b86687d1 (diff)
downloadefl-8c56edbdf5311295a9ef3254d20d413389756425.tar.gz
eina: fix eina_test_rwlock test on OSX.
add a reimplementation of clock_gettime for OSX within the test in order to be able to test eina_condition_timedwait Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/tests/eina/eina_test_lock.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/tests/eina/eina_test_lock.c b/src/tests/eina/eina_test_lock.c
index a149dea175..02c6286aa5 100644
--- a/src/tests/eina/eina_test_lock.c
+++ b/src/tests/eina/eina_test_lock.c
@@ -23,6 +23,24 @@
#include "eina_suite.h"
#include "Eina.h"
+#ifdef __MACH__
+# include <mach/clock.h>
+# include <mach/mach.h>
+
+#define CLOCK_REALTIME 0
+
+void clock_gettime(int mode, struct timespec* ts)
+{
+ clock_serv_t cclock;
+ mach_timespec_t mts;
+ host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
+ clock_get_time(cclock, &mts);
+ mach_port_deallocate(mach_task_self(), cclock);
+ ts->tv_sec = mts.tv_sec;
+ ts->tv_nsec = mts.tv_nsec;
+}
+#endif
+
static Eina_Spinlock spin;
static Eina_Thread thread;
static unsigned int counter;