PTHREAD_MUTEX_UNLOCK(3P) BSD PTHREAD_MUTEX_UNLOCK(3P)
NAME
pthread_mutex_unlock - Unlocks a mutex
SYNOPSIS
#include <pthread.h>
int pthread_mutex_unlock (mutex)
pthread_mutex_t *mutex;
DESCRIPTION
The pthread_mutex_unlock function unlocks the specified mutex. When the
mutex is unlocked, if more than one thread is waiting for the mutex, the
next thread to lock the mutex is determined by the scheduler.
The mutex argument specifies the ID of the mutex to unlock.
NOTES
This interface is based on draft 4 of the IEEE P1003.4a standard, and
will be changed to conform to the final version.
DIAGNOSTICS
Upon successful completion, a value of 0 (zero) is returned. Otherwise,
no mutex is created, -1 is returned, and errno is set to indicate the
error.
ERRORS
If the pthread_mutex_unlock function fails, errno may be set the the
following value:
[EINVAL] The value specified by the mutex argument is invalid.
[EPERM] The mutex is not locked by the calling thread.
SEE ALSO
pthread_mutex_init(3P), pthread_mutex_destroy(3P), pthread_mutex_lock(3P)