Unlocks a mutex.
pthread_mutex_unlock( mutex );
Argument Data Type Accessmutex opaque pthread_mutex_t read
#includeint pthread_mutex_unlock ( pthread_mutex_t *mutex);
The following describes the varied behavior of this routine:
If one or more threads are waiting to lock the specified mutex, and the mutex becomes unlocked, this routine causes one thread to unblock and try to acquire the mutex. The scheduling policy is used to determine which thread to unblock. For the SCHED_FIFO and SCHED_ RR policies, a blocked thread is chosen in priority order, using first-in/first-out within priorities. Note that the mutex may not be acquired by the awakened thread if any other running thread attempts to lock the mutex first.
On Digital Unix, if a signal is delivered to a thread waiting for a mutex, upon return from the signal handler, the thread resumes waiting for the mutex as if it was not interrupted.
Return Description0 Successful completion. [EINVAL] The value specified for mutex is invalid. [EPERM] The calling thread does not own the mutex.
pthread_mutexattr_settype_np pthread_mutex_destroy pthread_mutex_init pthread_mutex_lock pthread_mutex_trylock pthread_unlock_global_np