conditionally lock a recursive mutex
cc [options] -Kthread file
int rmutex_trylock(rmutex_t *rmutex);
rmutex_trylock attempts once to lock the
recursive mutual exclusion lock (rmutex) pointed to by rmutex.
If rmutex is available,
rmutex_trylock will return successfully
with rmutex locked.
If rmutex is already locked by another thread,
rmutex_trylock immediately returns EBUSY to the caller
without locking rmutex or blocking.
If rmutex is already held by the calling thread,
the recursive depth is incremented and control is returned
to the caller,
as if the lock had just been acquired.
rmutex must previously have been initialized
pointer to recursive mutex to be locked
rmutex_trylock is used when the caller does not want to block.
The locks acquired with rmutex_trylock should be released
rmutex_trylock returns zero for success
and an error number for failure.
If any of the following conditions is detected,
rmutex_trylock returns the corresponding value:
rmutex is locked by another thread
invalid argument specified
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004