From c0adae1f460d1b8d56069275f07c954f54530f71 Mon Sep 17 00:00:00 2001 From: deuce <> Date: Mon, 11 Jan 2016 12:23:37 +0000 Subject: [PATCH] Pretty sure we can go ahead and use nanosleep() now. --- src/xpdev/genwrap.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xpdev/genwrap.h b/src/xpdev/genwrap.h index 5e9cf52da9..d114b36832 100644 --- a/src/xpdev/genwrap.h +++ b/src/xpdev/genwrap.h @@ -294,9 +294,9 @@ DLLEXPORT int DLLCALL get_errno(void); tv.tv_sec=(sleep_msecs/1000); tv.tv_usec=((sleep_msecs%1000)*1000); \ pth_nap(tv); }) #else - #define SLEEP(x) ({ int sleep_msecs=x; struct timeval tv; \ - tv.tv_sec=(sleep_msecs/1000); tv.tv_usec=((sleep_msecs%1000)*1000); \ - select(0,NULL,NULL,NULL,&tv); }) + #define SLEEP(x) ({ int sleep_msecs=x; struct timespec ts={0}; \ + ts.tv_sec=(sleep_msecs/1000); ts.tv_nsec=((sleep_msecs%1000)*1000000); \ + nanosleep(&ts, NULL); }) #endif #define YIELD() SLEEP(1) -- GitLab