{
pthread_mutexattr_t attr;
- if( pthread_mutexattr_init( &attr ) )
+ if (unlikely(pthread_mutexattr_init (&attr)))
abort();
#ifdef NDEBUG
pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_NORMAL );
pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_ERRORCHECK );
# endif
#endif
- if( pthread_mutex_init( p_mutex, &attr ) )
+ if (unlikely(pthread_mutex_init (p_mutex, &attr)))
abort();
pthread_mutexattr_destroy( &attr );
}
{
pthread_mutexattr_t attr;
- pthread_mutexattr_init( &attr );
+ if (unlikely(pthread_mutexattr_init (&attr)))
+ abort();
#if defined (__GLIBC__) && (__GLIBC__ == 2) && (__GLIBC_MINOR__ < 6)
pthread_mutexattr_setkind_np( &attr, PTHREAD_MUTEX_RECURSIVE_NP );
#else
pthread_mutexattr_settype( &attr, PTHREAD_MUTEX_RECURSIVE );
#endif
- if( pthread_mutex_init( p_mutex, &attr ) )
+ if (unlikely(pthread_mutex_init (p_mutex, &attr)))
abort();
pthread_mutexattr_destroy( &attr );
}
{
pthread_condattr_t attr;
- if (pthread_condattr_init (&attr))
+ if (unlikely(pthread_condattr_init (&attr)))
abort ();
#if !defined (_POSIX_CLOCK_SELECTION)
/* Fairly outdated POSIX support (that was defined in 2001) */
pthread_condattr_setclock (&attr, CLOCK_MONOTONIC);
#endif
- if (pthread_cond_init (p_condvar, &attr))
+ if (unlikely(pthread_cond_init (p_condvar, &attr)))
abort ();
pthread_condattr_destroy (&attr);
}
*/
void vlc_sem_init (vlc_sem_t *sem, unsigned value)
{
- if (sem_init (sem, 0, value))
+ if (unlikely(sem_init (sem, 0, value)))
abort ();
}
*/
void vlc_rwlock_init (vlc_rwlock_t *lock)
{
- if (pthread_rwlock_init (lock, NULL))
+ if (unlikely(pthread_rwlock_init (lock, NULL)))
abort ();
}
{
struct vlc_timer *timer = malloc (sizeof (*timer));
- if (timer == NULL)
+ if (unlikely(timer == NULL))
return ENOMEM;
vlc_mutex_init (&timer->lock);
vlc_cond_init (&timer->wait);