diff options
Diffstat (limited to 'src/xine-utils')
-rw-r--r-- | src/xine-utils/monitor.c | 2 | ||||
-rw-r--r-- | src/xine-utils/utils.c | 20 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/xine-utils/monitor.c b/src/xine-utils/monitor.c index 8cbfdaa72..59d8a63d2 100644 --- a/src/xine-utils/monitor.c +++ b/src/xine-utils/monitor.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2003 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c index 8a9774b3d..2fb6ea554 100644 --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -478,23 +478,22 @@ char *xine_chomp(char *str) { * a thread-safe usecond sleep */ void xine_usec_sleep(unsigned usec) { -#if 0 -#if HAVE_NANOSLEEP +#ifdef WIN32 + /* select does not work on win32 */ + Sleep(usec / 1000); +#else +# if 0 +# if HAVE_NANOSLEEP /* nanosleep is prefered on solaris, because it's mt-safe */ struct timespec ts, remaining; - ts.tv_sec = usec / 1000000; ts.tv_nsec = (usec % 1000000) * 1000; while (nanosleep (&ts, &remaining) == -1 && errno == EINTR) ts = remaining; -#else -# if WIN32 - Sleep(usec / 1000); -# else +# else usleep(usec); -# endif -#endif -#else +# endif +# else if (usec < 10000) { usec = 10000; } @@ -502,6 +501,7 @@ void xine_usec_sleep(unsigned usec) { tm.tv_sec = usec / 1000000; tm.tv_usec = usec % 1000000; select(0, 0, 0, 0, &tm); +# endif #endif } |