Commit 4c35dd21 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix the kludge for old glibc

parent 3afd1ff1
...@@ -181,8 +181,8 @@ void vlc_threads_end( void ) ...@@ -181,8 +181,8 @@ void vlc_threads_end( void )
#endif #endif
} }
#ifdef __linux__ #if defined (__GLIBC__) && (__GLIBC_MINOR__ < 6)
/* This is not prototyped under Linux, though it exists. */ /* This is not prototyped under glibc, though it exists. */
int pthread_mutexattr_setkind_np( pthread_mutexattr_t *attr, int kind ); int pthread_mutexattr_setkind_np( pthread_mutexattr_t *attr, int kind );
#endif #endif
...@@ -199,7 +199,7 @@ int vlc_mutex_init( vlc_mutex_t *p_mutex ) ...@@ -199,7 +199,7 @@ int vlc_mutex_init( vlc_mutex_t *p_mutex )
# ifndef NDEBUG # ifndef NDEBUG
/* Create error-checking mutex to detect problems more easily. */ /* Create error-checking mutex to detect problems more easily. */
# if defined(SYS_LINUX) # if defined (__GLIBC__) && (__GLIBC_MINOR__ < 6)
pthread_mutexattr_setkind_np( &attr, PTHREAD_MUTEX_ERRORCHECK_NP ); pthread_mutexattr_setkind_np( &attr, PTHREAD_MUTEX_ERRORCHECK_NP );
# else # else
pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_ERRORCHECK ); pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_ERRORCHECK );
...@@ -250,7 +250,11 @@ int vlc_mutex_init_recursive( vlc_mutex_t *p_mutex ) ...@@ -250,7 +250,11 @@ int vlc_mutex_init_recursive( vlc_mutex_t *p_mutex )
int i_result; int i_result;
pthread_mutexattr_init( &attr ); pthread_mutexattr_init( &attr );
# if defined (__GLIBC__) && (__GLIBC_MINOR__ < 6)
pthread_mutexattr_setkind_np( &attr, PTHREAD_MUTEX_RECURSIVE_NP );
# else
pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE ); pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE );
# endif
i_result = pthread_mutex_init( p_mutex, &attr ); i_result = pthread_mutex_init( p_mutex, &attr );
pthread_mutexattr_destroy( &attr ); pthread_mutexattr_destroy( &attr );
return( i_result ); return( i_result );
......
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