The pthread_mutex_init function

Name

pthread_mutex_init -- 

Synopsis

#include <pthread.h>

int pthread_mutex_init (pthread_mutex_t *mutex , pthread_mutexattr_t *attr);

Description

The pthread_mutex_init function initializes the given mutex with the given attributes. If attr is null, then the default attributes are used.

Returns

The pthread_mutex_init function returns zero if the call is successful, otherwise it sets errno to EINVAL and returns -1.

Implementation Notes

The argument attr must be null. The default attributes are always used.