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

posix: drop hacks to support for glibc versions 2.5 and older

Even Ubuntu 8.04 LTS is more recent.
parent 9aa30ff3
...@@ -203,11 +203,6 @@ vlc_thread_fatal (const char *action, int error, ...@@ -203,11 +203,6 @@ vlc_thread_fatal (const char *action, int error,
# define VLC_THREAD_ASSERT( action ) ((void)val) # define VLC_THREAD_ASSERT( action ) ((void)val)
#endif #endif
#if defined (__GLIBC__) && (__GLIBC_MINOR__ < 6)
/* This is not prototyped under glibc, though it exists. */
int pthread_mutexattr_setkind_np( pthread_mutexattr_t *attr, int kind );
#endif
/** /**
* Initializes a fast mutex. * Initializes a fast mutex.
*/ */
...@@ -218,14 +213,9 @@ void vlc_mutex_init( vlc_mutex_t *p_mutex ) ...@@ -218,14 +213,9 @@ void vlc_mutex_init( vlc_mutex_t *p_mutex )
if (unlikely(pthread_mutexattr_init (&attr))) if (unlikely(pthread_mutexattr_init (&attr)))
abort(); abort();
#ifdef NDEBUG #ifdef NDEBUG
pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_NORMAL ); pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_DEFAULT);
#else #else
/* Create error-checking mutex to detect problems more easily. */ pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_ERRORCHECK);
# if defined (__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 6)
pthread_mutexattr_setkind_np( &attr, PTHREAD_MUTEX_ERRORCHECK_NP );
# else
pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_ERRORCHECK );
# endif
#endif #endif
if (unlikely(pthread_mutex_init (p_mutex, &attr))) if (unlikely(pthread_mutex_init (p_mutex, &attr)))
abort(); abort();
...@@ -242,11 +232,7 @@ void vlc_mutex_init_recursive( vlc_mutex_t *p_mutex ) ...@@ -242,11 +232,7 @@ void vlc_mutex_init_recursive( vlc_mutex_t *p_mutex )
if (unlikely(pthread_mutexattr_init (&attr))) if (unlikely(pthread_mutexattr_init (&attr)))
abort(); abort();
#if defined (__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 6) pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE);
pthread_mutexattr_setkind_np( &attr, PTHREAD_MUTEX_RECURSIVE_NP );
#else
pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE );
#endif
if (unlikely(pthread_mutex_init (p_mutex, &attr))) if (unlikely(pthread_mutex_init (p_mutex, &attr)))
abort(); abort();
pthread_mutexattr_destroy( &attr ); pthread_mutexattr_destroy( &attr );
......
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