C# Class Lucene.Net.Store.Lock.With

Utility class for executing code with exclusive access.
显示文件 Open project: paulirwin/lucene.net

Public Methods

Method Description
Run ( ) : object

Calls #doBody while lock is obtained. Blocks if lock cannot be obtained immediately. Retries to obtain lock once per second until it is obtained, or until it has tried ten times. Lock is released when #doBody exits.

With ( Lock @lock, long lockWaitTimeout ) : System

Constructs an executor that will grab the named lock.

Protected Methods

Method Description
DoBody ( ) : object

Code to execute with exclusive access.

Method Details

DoBody() protected abstract method

Code to execute with exclusive access.
protected abstract DoBody ( ) : object
return object

Run() public method

Calls #doBody while lock is obtained. Blocks if lock cannot be obtained immediately. Retries to obtain lock once per second until it is obtained, or until it has tried ten times. Lock is released when #doBody exits.
if lock could not /// be obtained if throws System.IO.IOException
public Run ( ) : object
return object

With() public method

Constructs an executor that will grab the named lock.
public With ( Lock @lock, long lockWaitTimeout ) : System
@lock Lock
lockWaitTimeout long
return System