Chat Support
Loupe - Log - Monitor - Resolve
Gibraltar.Data Namespace / InterprocessLockManager Class / Lock Method / Lock(Object,String,String,Int32) Method
The object that is requesting the lock (useful for debugging purposes)
The fully qualified path to the directory containing the index file of the repository
The name of the lock to get (locks are a combination of index and this name)
The maximum number of seconds to wait on the lock before giving up.

In This Topic
    Lock(Object,String,String,Int32) Method
    In This Topic
    Attempt to lock the repository with the provided index path.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Function Lock( _
       ByVal requester As Object, _
       ByVal indexPath As String, _
       ByVal lockName As String, _
       ByVal timeoutSeconds As Integer _
    ) As InterprocessLock
    public static InterprocessLock Lock( 
       object requester,
       string indexPath,
       string lockName,
       int timeoutSeconds
    )

    Parameters

    requester
    The object that is requesting the lock (useful for debugging purposes)
    indexPath
    The fully qualified path to the directory containing the index file of the repository
    lockName
    The name of the lock to get (locks are a combination of index and this name)
    timeoutSeconds
    The maximum number of seconds to wait on the lock before giving up.

    Return Value

    A Repository Lock object if the lock could be obtained or Null if the lock timed out.
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also