The function pthread_mutex_init allows you to specify a pointer to an attribute. But I have yet to find a good explanation of what pthread attributes are. I have always just supplied NULL. Is there a use to this argument?
The documentation, for those of you who forget it:
See Question&Answers more detail:osPTHREAD_MUTEX_INIT(3) BSD Library Functions Manual
PTHREAD_MUTEX_INIT(3)NAME pthread_mutex_init -- create a mutex
SYNOPSIS
#include <pthread.h> int pthread_mutex_init(pthread_mutex_t *restrict mutex, const pthread_mutexattr_t *restrict attr);
DESCRIPTION The pthread_mutex_init() function creates a new mutex, with attributes specified with attr. If attr is NULL, the default attributes are used.