HP-UX Reference Volume 4 of 5 > ppthread_mutex_unlock(3T)Pthread Library |
|
NAMEpthread_mutex_unlock() — unlock a mutex. DESCRIPTIONThe 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 VALUEUpon successful completion, pthread_mutex_unlock() returns zero. Otherwise, an error number is returned to indicate the error (the errno variable is not set). ERRORSFor each of the following conditions, if the condition is detected, the pthread_mutex_unlock() function returns the corresponding error number:
SEE ALSOpthread_mutex_init(3T), pthread_mutex_destroy(3T), pthread_mutex_lock(3T), pthread_mutex_trylock(3T). |