summaryrefslogtreecommitdiff
path: root/libraries/pthsem/0001-Use-monotonic-clock-for-pthsem.patch
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/pthsem/0001-Use-monotonic-clock-for-pthsem.patch')
-rw-r--r--libraries/pthsem/0001-Use-monotonic-clock-for-pthsem.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/libraries/pthsem/0001-Use-monotonic-clock-for-pthsem.patch b/libraries/pthsem/0001-Use-monotonic-clock-for-pthsem.patch
new file mode 100644
index 0000000000..c049529fbb
--- /dev/null
+++ b/libraries/pthsem/0001-Use-monotonic-clock-for-pthsem.patch
@@ -0,0 +1,35 @@
+From 1eedb024a141665fd186d1d51e73bb64c6202476 Mon Sep 17 00:00:00 2001
+From: Martin Koegler <mkoegler@auto.tuwien.ac.at>
+Date: Sat, 23 Aug 2008 00:54:20 +0200
+Subject: [PATCH] Use montonic clock for pthsem
+
+Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
+---
+ pth_time.c | 11 +++++++++++
+ 1 files changed, 11 insertions(+), 0 deletions(-)
+
+diff --git a/pth_time.c b/pth_time.c
+index b94dafe..e81f80a 100644
+--- a/pth_time.c
++++ b/pth_time.c
+@@ -60,6 +60,17 @@ intern void pth_time_usleep(unsigned long usec)
+ #else
+ #define __gettimeofday(t) gettimeofday(t, NULL)
+ #endif
++#undef __gettimeofday
++
++static int inline __gettimeofday(struct timeval *tv)
++{
++ struct timespec t;
++ int res = clock_gettime(CLOCK_MONOTONIC, &t);
++ tv->tv_sec = t.tv_sec;
++ tv->tv_usec = t.tv_nsec/1000;
++ return res;
++}
++
+ #define pth_time_set(t1,t2) \
+ do { \
+ if ((t2) == PTH_TIME_NOW) \
+--
+1.5.3.1
+