Commit c6e4a4b3 authored by Loïc Minier's avatar Loïc Minier

* removed usage of usleep (not thread safe) (by Meuuh)

parent 805a2fd1
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* Functions are prototyped in mtime.h. * Functions are prototyped in mtime.h.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2001 VideoLAN * Copyright (C) 1998-2001 VideoLAN
* $Id: mtime.c,v 1.28 2002/02/25 23:59:07 sam Exp $ * $Id: mtime.c,v 1.29 2002/05/17 15:14:47 lool Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -141,11 +141,7 @@ void mwait( mtime_t date ) ...@@ -141,11 +141,7 @@ void mwait( mtime_t date )
#else #else
# ifdef HAVE_USLEEP
struct timeval tv_date;
# else
struct timeval tv_date, tv_delay; struct timeval tv_date, tv_delay;
# endif
mtime_t delay; /* delay in msec, signed to detect errors */ mtime_t delay; /* delay in msec, signed to detect errors */
/* see mdate() about gettimeofday() possible errors */ /* see mdate() about gettimeofday() possible errors */
...@@ -169,9 +165,6 @@ void mwait( mtime_t date ) ...@@ -169,9 +165,6 @@ void mwait( mtime_t date )
# elif defined( ST_INIT_IN_ST_H ) # elif defined( ST_INIT_IN_ST_H )
st_usleep( delay ); st_usleep( delay );
# elif defined( HAVE_USLEEP )
usleep( delay );
# else # else
tv_delay.tv_sec = delay / 1000000; tv_delay.tv_sec = delay / 1000000;
tv_delay.tv_usec = delay % 1000000; tv_delay.tv_usec = delay % 1000000;
...@@ -199,9 +192,6 @@ void msleep( mtime_t delay ) ...@@ -199,9 +192,6 @@ void msleep( mtime_t delay )
#elif defined( ST_INIT_IN_ST_H ) #elif defined( ST_INIT_IN_ST_H )
st_usleep( delay ); st_usleep( delay );
#elif defined( HAVE_USLEEP )
usleep( delay );
#elif defined( WIN32 ) #elif defined( WIN32 )
Sleep( (int) (delay / 1000) ); Sleep( (int) (delay / 1000) );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment