try_lock_mutexT_try_lock_mutexTryLockMutexTryLockMutex (Operator)

Name

try_lock_mutexT_try_lock_mutexTryLockMutexTryLockMutex — 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()

Beschreibung

try_lock_mutextry_lock_mutexTryLockMutexTryLockMutexTryLockMutex verhält sich identisch zu lock_mutexlock_mutexLockMutexLockMutexLockMutex, 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

MutexHandleMutexHandleMutexHandleMutexHandlemutexHandle (input_control)  mutex HMutex, HTupleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Mutex-Synchronisationsobjekt.

BusyBusyBusyBusybusy (output_control)  number HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Mutex bereits gesperrt?

Ergebnis

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

Vorgänger

create_mutexcreate_mutexCreateMutexCreateMutexCreateMutex

Nachfolger

unlock_mutexunlock_mutexUnlockMutexUnlockMutexUnlockMutex

Siehe auch

lock_mutexlock_mutexLockMutexLockMutexLockMutex

Modul

Foundation