Skip to content
Snippets Groups Projects
Commit c0adae1f authored by deuce's avatar deuce
Browse files

Pretty sure we can go ahead and use nanosleep() now.

parent 8ec4d3bf
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment