pthread_mutex_unlock() — unlock a mutex.
Pointer to the mutex to be unlocked.
is called by the owner of the mutex referenced by
to unlock the mutex.
The manner in that the mutex is released is dependent upon the mutex's
For normal and default mutexes, undefined behavior will result if
is called on an unlocked mutex or by a thread that is not the current owner.
For recursive and error-checking mutexes, an error is returned if
is called on an unlocked mutex or by a thread which is not the current owner.
For recursive mutexes, the owner must call
as many times as the mutex was locked before another thread can lock the mutex.
If there are threads blocked on the mutex referenced by
releases the mutex, the scheduling policy is used to determine which thread
will acquire the mutex next.
Upon successful completion,
returns zero. Otherwise, an error number is returned to indicate the error
variable is not set).
For each of the following conditions, if the condition is detected, the
function returns the corresponding error number:
is not an initialized mutex.
The calling thread does not own
On HP-UX, this error is not detected for
parameter points to an illegal address.
was derived from the IEEE POSIX P1003.1c standard and HP extensions.
pthread_mutex_unlock(): POSIX 1003.1c.