Upon successful initialisation, the state of the mutex becomes initialised and unlocked. Attempting to initialise an already initialised mutex results in undefined behaviour. It is safe to destroy an initialised mutex that is unlocked. Attempting to destroy a locked mutex results in undefined behaviour. Otherwise, an error number is returned to indicate the error.
Insufficient memory exists to initialise the mutex.
The caller does not have the privilege to perform the operation. The implementation has detected an attempt to re-initialise the object referenced by mutex , a previously initialised, but not yet destroyed, mutex. The value specified by attr is invalid. The value specified by mutex is invalid.