pthread_mutex_unlock3
Unlock a mutex
Usage
#include <pthread.h>
int
pthread_mutex_unlock(pthread_mutex_t *mutex);
Overview
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
The pthread_mutex_unlock() function will fail if:
- [EINVAL]
-
The value specified by mutex is invalid.
- [EPERM]
-
The current thread does not hold a lock on mutex.
Releases
149 releases since Mac OS X 10.2; the text changed 3 times.