mutex_unlock(3scl)mutex_unlock(3scl)NAMEmutex_unlock - Unlocks the specified mutex.
LIBRARY
SCL Threads Library (libthread.so)
SYNOPSIS
#include <synch.h>
int mutex_unlock(
mutex_t *mutexp );
PARAMETERS
Address of the mutex to be unlocked.
DESCRIPTION
This routine unlocks the mutex specified by the mutexp argument.
SCL IMPLEMENTATION NOTESmutex_unlock(3scl) is implemented by calling pthread_mutex_unlock(3).
If the calling thread does not hold the mutex (either because the mutex
is unlocked or is held by another thread), then pthread_mutex_unlock(3)
may return either an EPERM status (which mutex_unlock(3scl) maps to 0
and writes a message outlining the error-code mapping to the SCL error‐
log), or it may just return 0. The end result in either case is that
mutex_unlock(3scl) returns 0, which is consistent with the observed
behavior on Solaris.
RETURN VALUES
If an error condition occurs, this routine returns an integer value
indicating the type of error.
Additional error return information may be written to the SCL error
log. Refer to scl_error_log(4scl) for details.
Possible return values are as follows: Successful completion. Or:
Error EPERM from pthread_mutex_unlock(3), meaning that the calling
thread does not own the mutex. A message is written to the SCL errorlog
which outlines the error-code mapping.
An internal implementation error occurred. Refer to the SCL errorlog
for additional information.
Note: EFAULT is not returned if mutexp is an illegal address. An ille‐
gal address generates a SIGSEGV signal, which by default will abort the
process and generate a core dump.
ERRORS
None.
RELATED INFORMATION
Functions: mutex_destroy(3scl), mutex_init(3scl), mutex_lock(3scl),
mutex_trylock(3scl), pthread_mutex_unlock(3), scl_intro(3scl),
scl_thread_intro(3scl)
Files: scl_error_log(4scl)
Manuals: Solaris Compatibility Libraries User's Guide
mutex_unlock(3scl)