Operator Reference
try_lock_mutex (Operator)
try_lock_mutex
— Lock a mutex synchronization object.
Signature
try_lock_mutex( : : MutexHandle : 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
- Multithreading type: independent (runs in parallel even with 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.
Possible Predecessors
Possible Successors
See also
Module
Foundation