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_mutexTryLockMutexTryLockMutexTryLockMutextry_lock_mutex verhält sich identisch zu lock_mutexlock_mutexLockMutexLockMutexLockMutexlock_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 BusyBusyBusyBusybusybusy 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

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

Mutex-Synchronisationsobjekt.

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

Mutex bereits gesperrt?

Ergebnis

Ist der Parameterwert korrekt, dann liefert try_lock_mutextry_lock_mutexTryLockMutexTryLockMutexTryLockMutextry_lock_mutex den Wert TRUE.Gegebenenfalls wird eine Fehlerbehandlung durchgeführt.

Vorgänger

create_mutexcreate_mutexCreateMutexCreateMutexCreateMutexcreate_mutex

Nachfolger

unlock_mutexunlock_mutexUnlockMutexUnlockMutexUnlockMutexunlock_mutex

Siehe auch

lock_mutexlock_mutexLockMutexLockMutexLockMutexlock_mutex

Modul

Foundation