Creates a mutex.
pthread_mutex_init( mutex, attr );
Argument Data Type Accessmutex opaque pthread_mutex_t write attr opaque pthread_ read mutexattr_t
int pthread_mutex_init ( pthread_mutex_t *mutex, pthread_mutexattr_t attr);
The mutex is created and initialized to the unlocked state.
The created mutex is not automatically deallocated because it is considered shared among multiple threads if the thread that called this routine terminates.
Return Error Description0 Successful completion. -1 [EAGAIN] The system lacks the necessary resources to initialize another mutex. The system-imposed limit on the total number of mutexes under execution by a singled user is exceeded. -1 [ENOMEM] Insufficient memory exists to initialize the mutex.