ClassesClassesClassesClasses | | | | Operators

try_lock_mutextry_lock_mutexTryLockMutextry_lock_mutexTryLockMutexTryLockMutex (Operator)

Name

try_lock_mutextry_lock_mutexTryLockMutextry_lock_mutexTryLockMutexTryLockMutex — Lock a mutex synchronization object.

Signature

try_lock_mutex( : : MutexHandle : Busy)

Herror try_lock_mutex(const Hlong MutexHandle, Hlong* Busy)

Herror T_try_lock_mutex(const Htuple MutexHandle, Htuple* Busy)

Herror try_lock_mutex(const HTuple& MutexHandle, Hlong* Busy)

Hlong HMutex::TryLockMutex() const

void TryLockMutex(const HTuple& MutexHandle, HTuple* Busy)

Hlong HMutex::TryLockMutex() const

void HOperatorSetX.TryLockMutex(
[in] VARIANT MutexHandle, [out] VARIANT* Busy)

Hlong HMutexX.TryLockMutex()

static void HOperatorSet.TryLockMutex(HTuple mutexHandle, out HTuple busy)

int HMutex.TryLockMutex()

Description

try_lock_mutextry_lock_mutexTryLockMutextry_lock_mutexTryLockMutexTryLockMutex behaves identically to lock_mutexlock_mutexLockMutexlock_mutexLockMutexLockMutex, 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 BusyBusyBusyBusyBusybusy. 1 indicates that the mutex was already locked before calling try_lock_mutextry_lock_mutexTryLockMutextry_lock_mutexTryLockMutexTryLockMutex, 0 that the mutex was unlocked (signaled).

Parallelization

Parameters

MutexHandleMutexHandleMutexHandleMutexHandleMutexHandlemutexHandle (input_control)  mutex HMutex, HTupleHTupleHMutex, HTupleHMutexX, VARIANTHtuple (integer) (IntPtr) (Hlong) (Hlong) (Hlong) (Hlong)

Mutex synchronization object.

BusyBusyBusyBusyBusybusy (output_control)  number HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Mutex already locked?

Result

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

Possible Predecessors

create_mutexcreate_mutexCreateMutexcreate_mutexCreateMutexCreateMutex

Possible Successors

unlock_mutexunlock_mutexUnlockMutexunlock_mutexUnlockMutexUnlockMutex

See also

lock_mutexlock_mutexLockMutexlock_mutexLockMutexLockMutex

Module

Foundation


ClassesClassesClassesClasses | | | | Operators