next up previous contents
Next: 9.13 fluke_mutex_unlock: unlock a Up: 9 Mutexes Previous: 9.11 fluke_mutex_set_state: set the

9.12 fluke_mutex_trylock: attempt to lock a mutex object

SYNOPSIS

fluke_error_t fluke_mutex_trylock(fluke_mutex_t *mutex);

DESCRIPTION

Attempt to acquire a mutex. If the mutex is held, the call returns immediately with a failure indication instead of blocking.

PARAMETERS

mutex
The mutex to lock.

RETURNS

Returns FLUKE_SUCCESS if the mutex was successfully locked or an error code if not.

ERRORS

If any of the following errors is detected, the appropriate error code is returned. All of these have an implicit FLUKE_ prefix.
MUTEX_HELD
The mutex is currently locked.

If any of the following errors is detected by the Fluke implementation, it causes the current thread to take a synchronous exception with one of the following codes. All of these have an implicit FLUKE_INSANITY_ prefix.
NO_OBJECT
mutex does not point to an active object.
NOT_MUTEX
The object pointed to by mutex is not a mutex object.
INVALID_OBJECT
The state of the mutex object has become invalid.



Utah Flux Research Group