summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
bd475b0)
- Don't use TIMER_ABSTIME which sucks (at least on Linux with HZ=1000)
- Cosmetic
configure.ac:
- Check for clock_nanosleep() rather than clock_gettime(), as it is more
recent and we need both.
dnl Don't link with rt when using GNU-pth
if test "${THREAD_LIB}" != "-lpth" && test "${THREAD_LIB}" != "-lst"; then
dnl Don't link with rt when using GNU-pth
if test "${THREAD_LIB}" != "-lpth" && test "${THREAD_LIB}" != "-lst"; then
- AC_CHECK_LIB(rt, clock_gettime, [
+ AC_CHECK_LIB(rt, clock_nanosleep, [
VLC_ADD_LDFLAGS([vlc],[-lrt])
VLC_ADD_LDFLAGS([vlc],[-lrt])
- AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define to 1 if you have clock_gettime.])
+ AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define to 1 if you have clock_nanosleep.])
], [
dnl HP/UX port
AC_CHECK_LIB(rt,sem_init, [VLC_ADD_LDFLAGS([vlc],[-lrt])])
], [
dnl HP/UX port
AC_CHECK_LIB(rt,sem_init, [VLC_ADD_LDFLAGS([vlc],[-lrt])])
-#elif defined (HAVE_CLOCK_GETTIME)
+#elif defined (HAVE_CLOCK_NANOSLEEP)
struct timespec ts;
# if (_POSIX_MONOTONIC_CLOCK - 0 >= 0)
struct timespec ts;
# if (_POSIX_MONOTONIC_CLOCK - 0 >= 0)
-#elif defined (HAVE_CLOCK_GETTIME)
+#elif defined (HAVE_CLOCK_NANOSLEEP)
+# if defined (HAVE_TIMER_ABSTIME_THAT_ACTUALLY_WORKS_WELL)
lldiv_t d = lldiv( date, 1000000 );
struct timespec ts = { d.quot, d.rem };
lldiv_t d = lldiv( date, 1000000 );
struct timespec ts = { d.quot, d.rem };
-# if (_POSIX_MONOTONIC_CLOCK - 0 >= 0)
+# if (_POSIX_MONOTONIC_CLOCK - 0 >= 0)
if( clock_nanosleep( CLOCK_MONOTONIC, TIMER_ABSTIME, &ts, NULL ) )
if( clock_nanosleep( CLOCK_MONOTONIC, TIMER_ABSTIME, &ts, NULL ) )
clock_nanosleep( CLOCK_REALTIME, TIMER_ABSTIME, &ts, NULL );
clock_nanosleep( CLOCK_REALTIME, TIMER_ABSTIME, &ts, NULL );
+# else
+ date -= mdate ();
+ if( date <= 0)
+ return;
+ msleep( date );
+# endif
#else
struct timeval tv_date;
#else
struct timeval tv_date;
#elif defined( WIN32 ) || defined( UNDER_CE )
Sleep( (int) (delay / 1000) );
#elif defined( WIN32 ) || defined( UNDER_CE )
Sleep( (int) (delay / 1000) );
-#elif defined( HAVE_CLOCK_GETTIME )
+#elif defined( HAVE_CLOCK_NANOSLEEP )
lldiv_t d = lldiv( delay, 1000000 );
struct timespec ts = { d.quot, d.rem * 1000 };
lldiv_t d = lldiv( delay, 1000000 );
struct timespec ts = { d.quot, d.rem * 1000 };
# if (_POSIX_CLOCK_MONOTONIC - 0 >= 0)
# if (_POSIX_CLOCK_MONOTONIC - 0 >= 0)
- if (clock_nanosleep( CLOCK_MONOTONIC, 0, &ts, NULL ) )
+ if( clock_nanosleep( CLOCK_MONOTONIC, 0, &ts, NULL ) )
# endif
clock_nanosleep( CLOCK_REALTIME, 0, &ts, NULL );
# endif
clock_nanosleep( CLOCK_REALTIME, 0, &ts, NULL );