rmutex_unlock(3synch) rmutex_unlock(3synch)
NAME
rmutex_unlock - unlock a recursive mutex
SYNOPSIS
cc [options] -Kthread file
#include <synch.h>
int rmutex_unlock(rmutex_t *rmutex);
Parameters
rmutex pointer to recursive mutex to be unlocked
DESCRIPTION
rmutex_unlock unlocks the recursive mutual exclusion lock
(rmutex) pointed to by rmutex.
rmutex_unlock checks the identity of the caller and if the
caller is the current owner of rmutex it checks the depth
count.
If the depth count is greater than 0, it decrements the
count and returns to the caller without unlocking the
rmutex.
If the depth count is 0, the rmutex is unlocked.
If the caller is not the current owner of rmutex, that is, the
caller does not hold the lock, rmutex_unlock will fail and
return EACCES.
If there are one or more threads waiting for rmutex when it is
unlocked, at least one waiting thread is allowed to try again
to lock rmutex.
Return Values
rmutex_unlock returns zero for success and an error number for
failure, as described below.
Errors
If any of the following conditions is detected, rmutex_unlock
returns the corresponding value:
EACCES The caller did not previously lock the rmutex.
EINVAL Invalid argument specified.
Copyright 1994 Novell, Inc. Page 1
rmutex_unlock(3synch) rmutex_unlock(3synch)
REFERENCES
mutex(3synch), rmutex(3synch), rmutex_destroy(3synch),
rmutex_init(3synch), rmutex_lock(3synch),
rmutex_trylock(3synch), synch(3synch)
Copyright 1994 Novell, Inc. Page 2