HALCON Reference Manual 10.0.2
Table of Contents / System / Multithreading ClassesClassesClasses | | | Operators

lock_mutexlock_mutexlock_mutexLockMutexLockMutex (Operator)

Name

lock_mutexlock_mutexlock_mutexLockMutexLockMutex — Lock a mutex synchronization object.

Signature

lock_mutex( : : MutexHandle : )

Herror lock_mutex(const Hlong MutexHandle)

Herror T_lock_mutex(const Htuple MutexHandle)

Herror lock_mutex(const HTuple& MutexHandle)

void HMutex::LockMutex() const

void HOperatorSetX.LockMutex([in] VARIANT MutexHandle)

void HMutexX.LockMutex()

static void HOperatorSet.LockMutex(HTuple mutexHandle)

void HMutex.LockMutex()

Description

lock_mutexlock_mutexlock_mutexLockMutexLockMutex locks the mutex given by MutexHandleMutexHandleMutexHandleMutexHandlemutexHandle. If the mutex is currently unlocked, it becomes locked and owned by the calling thread, and lock_mutexlock_mutexlock_mutexLockMutexLockMutex 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_mutexcreate_mutexcreate_mutexCreateMutexCreateMutex.

Parallelization

Parameters

MutexHandleMutexHandleMutexHandleMutexHandlemutexHandle (input_control)  mutex HMutex, HTupleHMutex, HTupleHMutexX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong)

Mutex synchronization object.

Result

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

Possible Predecessors

create_mutexcreate_mutexcreate_mutexCreateMutexCreateMutex

Possible Successors

unlock_mutexunlock_mutexunlock_mutexUnlockMutexUnlockMutex

See also

try_lock_mutextry_lock_mutextry_lock_mutexTryLockMutexTryLockMutex

Module

Foundation


Table of Contents / System / Multithreading ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH