summaryrefslogtreecommitdiff
path: root/subprojects/packagefiles/libev/libev_nn_thread_sleep.diff
blob: 527f555cf88911e476746e96a652bee69534e06c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
--- a/ev.c 2020-03-18 08:27:32.000000000 -0400
+++ b/ev.c 2024-01-16 15:42:39.360703755 -0400
@@ -216,6 +216,8 @@
 
 #include <signal.h>
 
+#include <nnwt/thread.h>
+
 #ifdef EV_H
 # include EV_H
 #else
@@ -2216,24 +2218,7 @@
 {
   if (delay > EV_TS_CONST (0.))
     {
-#if EV_USE_NANOSLEEP
-      struct timespec ts;
-
-      EV_TS_SET (ts, delay);
-      nanosleep (&ts, 0);
-#elif defined _WIN32
-      /* maybe this should round up, as ms is very low resolution */
-      /* compared to select (µs) or nanosleep (ns) */
-      Sleep ((unsigned long)(EV_TS_TO_MSEC (delay)));
-#else
-      struct timeval tv;
-
-      /* here we rely on sys/time.h + sys/types.h + unistd.h providing select */
-      /* something not guaranteed by newer posix versions, but guaranteed */
-      /* by older ones */
-      EV_TV_SET (tv, delay);
-      select (0, 0, 0, 0, &tv);
-#endif
+      nn_thread_sleep (delay);
     }
 }