DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

_lwp_mutex_unlock(S)


_lwp_mutex_unlock -- unlock a mutex

Synopsis

   #include <synch.h>
   

int _lwp_mutex_unlock(lwp_mutex_t *mutex);

Parameters


mutex
pointer to mutex to be unlocked

Description

_lwp_mutex_unlock unlocks the mutex pointed to by mutex.

If there are one or more lightweight processes (LWPs) waiting for the mutex when _lwp_mutex_unlock is called, at least one waiting LWP is allowed to attempt acquisition of the mutex.

Return values

_lwp_mutex_unlock returns zero for success and an error number for failure, as described below.

Errors

If any of the following conditions is detected, _lwp_mutex_unlock fails and returns the corresponding value:

EINVAL
The mutual exclusion variable pointed to by mutex is invalid.

EFAULT
The mutex parameter points to an illegal address. (This error may not be detected; a SIGSEGV signal may be posted to the faulting LWP if an illegal address is used.)

Usage

The locks acquired with _lwp_mutex_lock and _lwp_mutex_trylock should be released with _lwp_mutex_unlock.

References

_lwp_mutex_lock(S), _lwp_mutex_trylock(S), mutex_destroy(SYNCH), mutex_init(SYNCH), mutex_lock(SYNCH), mutex_trylock(SYNCH), mutex_unlock(SYNCH)

Notices

Lightweight processes (LWPs) are internal interfaces and are subject to change. Their use should be avoided.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005