Makes a single attempt to acquire the specified mutex.
#include <nks/synch.h> NXBool_t NXTryLock( NXMutex_t *mutex);
(IN) Points to the mutex to acquire.
Because this is a conditional acquisition, the hierarchy constraint for locks is relaxed for this acquisition. If the lock being acquired is not available (is held by a different context), NXTryLock makes no further attempt and returns FALSE.
NXTryLock is a macro unless NDEBUG is defined; otherwise, it consumes NXMutexTestFlag, a function which should only be used for debugging and which produces an assertion if the mutex is used recursively. In production code, NDEBUG should be defined.
For sample code, see Mutex.c.