xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

HB_MutexTryLock()

Tries to obtain a permanent lock on a Mutex.

Syntax

HB_MutexTryLock( <pMutexHandle> ) --> lSuccess

Arguments

<pMutexHandle>
This is the handle of the Mutex to lock. It is the return value of HB_MutexCreate().

Return

The function returns .T. (true) when the Mutex is locked, otherwise .F. (false).

Description

The function works like HB_MutexLock() but does not wait when the Mutex is currently locked. Instead, it returns .F. (false) so that the current thread continues to run. If .T. (true) is returned, the current thread has obtained a Mutex lock, which must be unlocked later with HB_MutexUnlock().

Info

See also:GetCurrentThread(), GetThreadID(), HB_MutexCreate(), HB_MutexLock(), HB_MutexTimeoutLock(), HB_MutexUnlock(), Notify(), StartThread(), Subscribe()
Category: Multi-threading functions , Mutex functions , xHarbour extensions
Source:vm\thread.c
LIB:xhbmt.lib
DLL:xhbmtdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe