Skip to content

lock_mutexLockMutexLockMutexlock_mutexT_lock_mutexπŸ”—

Short descriptionπŸ”—

lock_mutexLockMutexLockMutexlock_mutexT_lock_mutex β€” Lock a mutex synchronization object.

SignatureπŸ”—

lock_mutex( mutex MutexHandle )void LockMutex( const HTuple& MutexHandle )static void HOperatorSet.LockMutex( HTuple mutexHandle )def lock_mutex( mutex_handle: HHandle ) -> None

Herror T_lock_mutex( const Htuple MutexHandle )

void HMutex::LockMutex( ) const

void HMutex.LockMutex( )

DescriptionπŸ”—

lock_mutexLockMutex locks the mutex given by MutexHandlemutexHandlemutex_handle. If the mutex is currently unlocked, it becomes locked and owned by the calling thread, and lock_mutexLockMutex returns immediately. If the mutex is already locked by another thread, the calling thread waits until the mutex is unlocked. The kind of wait is defined by the mutex’ attributes set during creation in create_mutexCreateMutex.

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πŸ”—

MutexHandlemutexHandlemutex_handle (input_control) mutex β†’ (handle)HTuple (HHandle)HMutex, HTuple (IntPtr)HHandleHtuple (handle)

Mutex synchronization object.

ResultπŸ”—

If the mutex handle is valid, the operator lock_mutexLockMutex returns 2 (H_MSG_TRUE). If necessary, an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

create_mutexCreateMutex

Possible successors

unlock_mutexUnlockMutex

See also

try_lock_mutexTryLockMutex

ModuleπŸ”—

Foundation