#include <pthread.h> int
pthread_mutex_init (pthread_mutex_t *mutex const pthread_mutexattr_t *attr);
DESCRIPTION
The
pthread_mutex_init ();
function creates a new mutex, with attributes specified with
Fa attr .
If
Fa attr
is NULL the default attributes are used.
RETURN VALUES
If successful,
pthread_mutex_init ();
will return zero and put the new mutex id into
Fa mutex ,
otherwise an error number will be returned to indicate the error.
ERRORS
The
pthread_mutex_init ();
function will fail if:
Bq Er EINVAL
The value specified by
Fa attr
is invalid.
Bq Er ENOMEM
The process cannot allocate enough memory to create another mutex.