]> git.sesse.net Git - vlc/commitdiff
Return an error if timer expires, but still do not print it
authorRémi Denis-Courmont <rem@videolan.org>
Sun, 16 Sep 2007 10:27:09 +0000 (10:27 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Sun, 16 Sep 2007 10:27:09 +0000 (10:27 +0000)
include/vlc_threads_funcs.h

index b497e3703ae7299d150ade378e7f15aaf7947f39..bf7c868bbca6703ed5cf0299d5e8798a80cba2fe 100644 (file)
@@ -552,6 +552,8 @@ static inline int __vlc_cond_wait( const char * psz_file, int i_line,
 
 /*****************************************************************************
  * vlc_cond_timedwait: wait until condition completion or expiration
+ *****************************************************************************
+ * Returns 0 if object signaled, an error code in case of timeout or error.
  *****************************************************************************/
 #define vlc_cond_timedwait( P_COND, P_MUTEX, DEADLINE )                      \
     __vlc_cond_timedwait( __FILE__, __LINE__, P_COND, P_MUTEX, DEADLINE  )
@@ -582,7 +584,7 @@ static inline int __vlc_cond_timedwait( const char * psz_file, int i_line,
 
     i_res = pthread_cond_timedwait( &p_condvar->cond, &p_mutex->mutex, &ts );
     if( i_res == ETIMEDOUT )
-        i_res = 0; /* this error is perfectly normal */
+        return ETIMEDOUT; /* this error is perfectly normal */
     else
     if ( i_res ) /* other errors = bug */
     {