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)
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 @@
23#include "eina_suite.h" 23#include "eina_suite.h"
24#include "Eina.h" 24#include "Eina.h"
25 25
26#ifdef __MACH__
27# include <mach/clock.h>
28# include <mach/mach.h>
29
30#define CLOCK_REALTIME 0
31
32void clock_gettime(int mode, struct timespec* ts)
33{
34 clock_serv_t cclock;
35 mach_timespec_t mts;
36 host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
37 clock_get_time(cclock, &mts);
38 mach_port_deallocate(mach_task_self(), cclock);
39 ts->tv_sec = mts.tv_sec;
40 ts->tv_nsec = mts.tv_nsec;
41}
42#endif
43
26static Eina_Spinlock spin; 44static Eina_Spinlock spin;
27static Eina_Thread thread; 45static Eina_Thread thread;
28static unsigned int counter; 46static unsigned int counter;