Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pthread_mutex_unlock(3) [osx man page]

PTHREAD_MUTEX_UNLOCK(3) 				   BSD Library Functions Manual 				   PTHREAD_MUTEX_UNLOCK(3)

NAME
pthread_mutex_unlock -- unlock a mutex SYNOPSIS
#include <pthread.h> int pthread_mutex_unlock(pthread_mutex_t *mutex); DESCRIPTION
If the current thread holds the lock on mutex, then the pthread_mutex_unlock() function unlocks mutex. Calling pthread_mutex_unlock() with a mutex that the calling thread does not hold will result in undefined behavior. RETURN VALUES
If successful, pthread_mutex_unlock() will return zero. Otherwise, an error number will be returned to indicate the error. ERRORS
pthread_mutex_unlock() will fail if: [EINVAL] The value specified by mutex is invalid. [EPERM] The current thread does not hold a lock on mutex. SEE ALSO
pthread_mutex_destroy(3), pthread_mutex_init(3), pthread_mutex_lock(3), pthread_mutex_trylock(3) STANDARDS
pthread_mutex_unlock() conforms to ISO/IEC 9945-1:1996 (``POSIX.1''). BSD
July 30, 1998 BSD

Check Out this Related Man Page

pthread_mutex_unlock(3T)												  pthread_mutex_unlock(3T)

NAME
pthread_mutex_unlock() - unlock a mutex. SYNOPSIS
PARAMETERS
mutex Pointer to the mutex to be unlocked. DESCRIPTION
The function 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 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 mutex when releases the mutex, the scheduling policy is used to determine which thread will acquire the mutex next. RETURN VALUE
Upon successful completion, returns zero. Otherwise, an error number is returned to indicate the error (the variable is not set). ERRORS
For each of the following conditions, if the condition is detected, the function 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 or mutexes. [EFAULT] mutex parameter points to an illegal address. AUTHOR
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 Library pthread_mutex_unlock(3T)
Man Page