try_lock_mutexT_try_lock_mutexTryLockMutexTryLockMutextry_lock_mutex (Operator)

Name

try_lock_mutexT_try_lock_mutexTryLockMutexTryLockMutextry_lock_mutex — Sperren eines Mutex-Synchronisationsobjektes, wenn er frei ist.

Signatur

try_lock_mutex( : : MutexHandle : Busy)

Herror T_try_lock_mutex(const Htuple MutexHandle, Htuple* Busy)

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

Hlong HMutex::TryLockMutex() const

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

int HMutex.TryLockMutex()

def try_lock_mutex(mutex_handle: HHandle) -> int

Beschreibung

try_lock_mutextry_lock_mutexTryLockMutexTryLockMutextry_lock_mutex verhält sich identisch zu lock_mutexlock_mutexLockMutexLockMutexlock_mutex, bis auf dass der aufrufende Thread nicht blockiert, wenn der Mutex bereits gesperrt ist. Der Aufruf kommt in jedem Fall sofort zurück und enthält im Parameter BusyBusyBusybusybusy den Zustand des Mutexes vor dem Versuch ihn zu sperren. 1 bedeutet, dass der Mutex bereits gesperrt ist, 0, dass der Mutex frei war und nun durch den aufrufenden Thread gesperrt wurde.

Ausführungsinformationen

Parameter

MutexHandleMutexHandleMutexHandlemutexHandlemutex_handle (input_control)  mutex HMutex, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Mutex-Synchronisationsobjekt.

BusyBusyBusybusybusy (output_control)  number HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Mutex bereits gesperrt?

Ergebnis

Ist der Parameterwert korrekt, dann liefert try_lock_mutextry_lock_mutexTryLockMutexTryLockMutextry_lock_mutex den Wert 2 ( H_MSG_TRUE) .Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

create_mutexcreate_mutexCreateMutexCreateMutexcreate_mutex

Nachfolger

unlock_mutexunlock_mutexUnlockMutexUnlockMutexunlock_mutex

Siehe auch

lock_mutexlock_mutexLockMutexLockMutexlock_mutex

Modul

Foundation