]> git.sesse.net Git - vlc/blobdiff - include/vlc_threads_funcs.h
some media descriptor tests
[vlc] / include / vlc_threads_funcs.h
index 1b63750d72f96f9db3e8a320d0952c0a31ca3a5d..bf0566afdc0ef0d0e46d2cff688423c34c92e629 100644 (file)
 #ifndef _VLC_THREADFUNCS_H_
 #define _VLC_THREADFUNCS_H_
 
+#if defined( WIN32 ) && !defined ETIMEDOUT
+#  define ETIMEDOUT 10060 /* This is the value in winsock.h. */
+#endif
+
 /*****************************************************************************
  * Function definitions
  *****************************************************************************/
@@ -90,9 +94,13 @@ static inline void __vlc_mutex_lock( const char * psz_file, int i_line,
                                     vlc_mutex_t * p_mutex )
 {
 #if defined( UNDER_CE )
+    VLC_UNUSED( psz_file); VLC_UNUSED( i_line );
+
     EnterCriticalSection( &p_mutex->csection );
 
 #elif defined( WIN32 )
+    VLC_UNUSED( psz_file); VLC_UNUSED( i_line );
+
     if( p_mutex->mutex )
         WaitForSingleObject( p_mutex->mutex, INFINITE );
     else
@@ -124,9 +132,13 @@ static inline void __vlc_mutex_unlock( const char * psz_file, int i_line,
                                       vlc_mutex_t *p_mutex )
 {
 #if defined( UNDER_CE )
+    VLC_UNUSED( psz_file); VLC_UNUSED( i_line );
+
     LeaveCriticalSection( &p_mutex->csection );
 
 #elif defined( WIN32 )
+    VLC_UNUSED( psz_file); VLC_UNUSED( i_line );
+
     if( p_mutex->mutex )
         ReleaseMutex( p_mutex->mutex );
     else
@@ -164,9 +176,13 @@ static inline void __vlc_cond_signal( const char * psz_file, int i_line,
                                       vlc_cond_t *p_condvar )
 {
 #if defined( UNDER_CE )
+    VLC_UNUSED( psz_file); VLC_UNUSED( i_line );
+
     PulseEvent( p_condvar->event );
 
 #elif defined( WIN32 )
+    VLC_UNUSED( psz_file); VLC_UNUSED( i_line );
+
     /* Release one waiting thread if one is available. */
     /* For this trick to work properly, the vlc_cond_signal must be surrounded
      * by a mutex. This will prevent another thread from stealing the signal */
@@ -257,6 +273,8 @@ static inline void __vlc_cond_wait( const char * psz_file, int i_line,
     vlc_mutex_lock( p_mutex );
 
 #elif defined( WIN32 )
+    VLC_UNUSED( psz_file); VLC_UNUSED( i_line );
+
     if( !p_condvar->semaphore )
     {
         /* Increase our wait count */
@@ -381,6 +399,8 @@ static inline int __vlc_cond_timedwait( const char * psz_file, int i_line,
        return ETIMEDOUT; /* this error is perfectly normal */
 
 #elif defined( WIN32 )
+    VLC_UNUSED( psz_file); VLC_UNUSED( i_line );
+
     DWORD result;
 
     mtime_t delay_ms = (deadline - mdate())/1000;
@@ -561,6 +581,7 @@ static inline void vlc_spin_lock (vlc_spinlock_t *spin)
 {
     int val = pthread_spin_lock (&spin->spin);
     assert (val == 0);
+    (void)val;
 }
 
 /**
@@ -570,6 +591,7 @@ static inline void vlc_spin_unlock (vlc_spinlock_t *spin)
 {
     int val = pthread_spin_unlock (&spin->spin);
     assert (val == 0);
+    (void)val;
 }
 
 /**
@@ -579,6 +601,7 @@ static inline void vlc_spin_destroy (vlc_spinlock_t *spin)
 {
     int val = pthread_spin_destroy (&spin->spin);
     assert (val == 0);
+    (void)val;
 }
 
 #elif defined( WIN32 )
@@ -615,7 +638,6 @@ static inline void vlc_spin_unlock (vlc_spinlock_t *spin)
 static inline void vlc_spin_destroy (vlc_spinlock_t *spin)
 {
     DeleteCriticalSection(spin);
-    return 0;
 }