Commit b0c5b0a6 authored by Rafaël Carré's avatar Rafaël Carré

Factorize [22111]

parent 0d41ec4c
...@@ -297,31 +297,21 @@ int __vlc_mutex_init( vlc_object_t *p_this, vlc_mutex_t *p_mutex ) ...@@ -297,31 +297,21 @@ int __vlc_mutex_init( vlc_object_t *p_this, vlc_mutex_t *p_mutex )
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) #elif defined( PTHREAD_COND_T_IN_PTHREAD_H )
# if defined(DEBUG) # if defined(DEBUG)
# if defined(SYS_LINUX)
{ {
/* Create error-checking mutex to detect problems more easily. */ /* Create error-checking mutex to detect problems more easily. */
pthread_mutexattr_t attr; pthread_mutexattr_t attr;
int i_result; int i_result;
pthread_mutexattr_init( &attr ); pthread_mutexattr_init( &attr );
# if defined(SYS_LINUX)
pthread_mutexattr_setkind_np( &attr, PTHREAD_MUTEX_ERRORCHECK_NP ); pthread_mutexattr_setkind_np( &attr, PTHREAD_MUTEX_ERRORCHECK_NP );
i_result = pthread_mutex_init( &p_mutex->mutex, &attr );
pthread_mutexattr_destroy( &attr );
return( i_result );
}
# else # else
{
/* Create error-checking mutex to detect problems more easily. */
pthread_mutexattr_t attr;
int i_result;
pthread_mutexattr_init( &attr );
pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_ERRORCHECK ); pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_ERRORCHECK );
# endif
i_result = pthread_mutex_init( &p_mutex->mutex, &attr ); i_result = pthread_mutex_init( &p_mutex->mutex, &attr );
pthread_mutexattr_destroy( &attr ); pthread_mutexattr_destroy( &attr );
return( i_result ); return( i_result );
} }
# endif
# endif # endif
return pthread_mutex_init( &p_mutex->mutex, NULL ); return pthread_mutex_init( &p_mutex->mutex, NULL );
......
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