HP-UX Reference (11i v1 00/12) - 3 Library Functions N-Z (vol 7)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man3/nan.3m
________________________________________________________________
___ ___
p
pthread_mutex_unlock(3T) pthread_mutex_unlock(3T)
(Pthread Library)
NAME
pthread_mutex_unlock() - unlock a mutex
SYNOPSIS
#include <pthread.h>
int pthread_mutex_unlock(
pthread_mutex_t *mutex
);
PARAMETERS
mutex Pointer to the mutex to be unlocked.
DESCRIPTION
The function pthread_mutex_unlock() is called by the owner of the mutex referenced by mutex to
unlock the mutex. The manner in that the mutex is released is dependent upon the mutex’s type attribute.
For normal and default mutexes, undefined behavior will result if pthread_mutex_unlock() 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 pthread_mutex_unlock()
is called on an unlocked mutex or by a
thread which is not the current owner.
For recursive mutexes, the owner must call
pthread_mutex_unlock()
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 mutex when
pthread_mutex_unlock()
releases the mutex, the scheduling policy is used to determine which thread will acquire the mutex next.
RETURN VALUE
Upon successful completion, pthread_mutex_unlock()
returns zero. Otherwise, an error number is
returned to indicate the error (the
errno variable is not set).
ERRORS
For each of the following conditions, if the condition is detected, the pthread_mutex_unlock()
func-
tion returns the corresponding error number:
[EINVAL] mutex is not an initialized mutex.
[EPERM] The calling thread does not own mutex. On HP-UX, this error is not detected for
PTHREAD_MUTEX_FAST
or PTHREAD_MUTEX_DEFAULT mutexes.
[EFAULT] mutex parameter points to an illegal address.
AUTHOR
pthread_mutex_unlock()
was derived from the IEEE POSIX P1003.1c standard and HP extensions.
SEE ALSO
pthread_mutex_init(3T), pthread_mutex_destroy(3T), pthread_mutex_lock(3T), pthread_mutex_trylock(3T).
STANDARDS CONFORMANCE
pthread_mutex_unlock()
: POSIX 1003.1c.
HP-UX Release 11i: December 2000 − 1 − Section 3−−693
___
___