conditionally lock a mutex
cc [options] -Kthread file
int mutex_trylock(mutex_t *mutex);
mutex_trylock attempts once to lock the
mutual exclusion lock (mutex) pointed to by mutex.
pointer to mutex to be locked
If mutex is available,
mutex_trylock will return successfully
with mutex locked.
If mutex is already locked,
mutex_trylock immediately returns EBUSY to the caller
without acquiring mutex or blocking.
mutex must previously have been initialized,
either by mutex_init, or statically (see
mutex_trylock is used when the caller does not want to block.
Mutexes acquired with mutex_trylock should be released
mutex_trylock returns zero for success
and an error number for failure.
If the following condition occurs,
mutex_trylock returns the corresponding value:
mutex is already locked
If the following condition is detected,
mutex_trylock fails and returns the corresponding value:
invalid argument specified
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004