Delen via


LockManager.TryGetLock Method (ILockName, LockManager.LockType, Int64, Int32)

Get a named lock

Namespace:  Microsoft.TeamFoundation.Framework.Server
Assembly:  Microsoft.TeamFoundation.Framework.Server (in Microsoft.TeamFoundation.Framework.Server.dll)

Syntax

'Declaration
Public Function TryGetLock ( _
    lockName As ILockName, _
    lockType As LockManager.LockType, _
    requestId As Long, _
    millisecondsTimeout As Integer _
) As Boolean
public bool TryGetLock(
    ILockName lockName,
    LockManager.LockType lockType,
    long requestId,
    int millisecondsTimeout
)
public:
bool TryGetLock(
    ILockName^ lockName, 
    LockManager::LockType lockType, 
    long long requestId, 
    int millisecondsTimeout
)
member TryGetLock : 
        lockName:ILockName * 
        lockType:LockManager.LockType * 
        requestId:int64 * 
        millisecondsTimeout:int -> bool
public function TryGetLock(
    lockName : ILockName, 
    lockType : LockManager.LockType, 
    requestId : long, 
    millisecondsTimeout : int
) : boolean

Parameters

Return Value

Type: System.Boolean
Returns Boolean.

Remarks

This method tried to use the cached lock object for this name if it is not disposed, otherwise it allocates a new lock object and updates the cached object reference.

.NET Framework Security

See Also

Reference

LockManager Class

TryGetLock Overload

Microsoft.TeamFoundation.Framework.Server Namespace