fluke_error_t fluke_mutex_trylock(fluke_mutex_t *mutex);
Attempt to acquire a mutex. If the mutex is held, the call returns immediately with a failure indication instead of blocking.
- mutex
- The mutex to lock.
Returns FLUKE_SUCCESS if the mutex was successfully locked or an error code if not.
If any of the following errors is detected, the appropriate error code is returned. All of these have an implicit FLUKE_ prefix.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.
- MUTEX_HELD
- The mutex is currently locked.
- 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.