try_lock_mutex🔗
Short description🔗
try_lock_mutex — Lock a mutex synchronization object.
Signature🔗
try_lock_mutex( mutex MutexHandle, out number Busy )
Description🔗
try_lock_mutex behaves identically to lock_mutex, except
that it does not block the calling thread if the mutex is already locked by
another thread but returns immediately. The state of the mutex before trying
to lock it is returned in Busy. 1 indicates that the mutex
was already locked before calling try_lock_mutex, 0 that
the mutex was unlocked (signaled).
Execution information🔗
Execution information
-
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
-
Multithreading scope: global (may be called from any thread).
-
Processed without parallelization.
Parameters🔗
MutexHandle (input_control) mutex → (handle)
Mutex synchronization object.
Busy (output_control) number → (integer)
Mutex already locked?
Result🔗
If the mutex handle is valid, the operator try_lock_mutex
returns 2 (H_MSG_TRUE). If necessary, an exception is raised.
Combinations with other operators🔗
Combinations
Possible predecessors
Possible successors
See also
Module🔗
Foundation