pthread_mutex_lock.3t (2010 09)
p
pthread_mutex_lock(3T) pthread_mutex_lock(3T)
(Pthread Library)
If any of the following occur, the
pthread_mutex_lock()
and pthread_mutex_trylock()
func-
tions return the corresponding error number:
[EAGAIN] mutex could not be acquired because the maximum number of recursive locks for
mutex has been exceeded. This error is not detected on HP-UX.
[EINVAL] mutex is not an initialized mutex.
[EFAULT] mutex parameter points to an illegal address.
If any of the following occur, the
pthread_mutex_lock()
function returns the corresponding error
number:
[EDEADLK] The current thread already owns the mutex. This error will be detected only for
PTHREAD_MUTEX_ERRORCHECK
mutexes on HP-UX.
WARNINGS
A recursive mutex can be locked more than once by the same thread without causing that thread to
deadlock. Undefined behavior may result if the owner of a recursive mutex tries to lock the mutex too
many times.
AUTHOR
pthread_mutex_lock()
and pthread_mutex_trylock() was derived from the IEEE POSIX
P1003.1c standard and X/Open
SEE ALSO
pthread_mutex_init(3T), pthread_mutex_destroy(3T), pthread_mutex_unlock(3T).
STANDARDS CONFORMANCE
pthread_mutex_lock()
: POSIX 1003.1c.
pthread_mutex_trylock()
: POSIX 1003.1c.
2 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: September 2010