pthread_mutex_init() returns zero after completing successfully. Any other return value indicates that an error occurred. When any of the following conditions occurs, the function fails and returns the corresponding value.
EBUSY
Description:The implementation has detected an attempt to reinitialize the object referenced by mp, a previously initialized but not yet destroyed mutex.
EINVAL
Description:The mattr attribute value is invalid. The mutex has not been modified.
EFAULT
Description:The address for the mutex pointed at by mp is invalid.