Class Lock.With<T>
Utility class for executing code with exclusive access.
Inheritance
System.Object
Lock.With<T>
Namespace: Lucene.Net.Store
Assembly: Lucene.Net.dll
Syntax
public abstract class With<T> : object
Type Parameters
Name | Description |
---|---|
T |
Constructors
| Improve this Doc View SourceWith(Lock, Int64)
Constructs an executor that will grab the named lock
.
Declaration
public With(Lock lock, long lockWaitTimeout)
Parameters
Type | Name | Description |
---|---|---|
Lock | lock | the Lock instance to use |
System. |
lockWaitTimeout | length of time to wait in milliseconds or LOCK_OBTAIN_WAIT_FOREVER to retry forever |
Methods
| Improve this Doc View SourceDoBody()
Code to execute with exclusive access.
Declaration
protected abstract T DoBody()
Returns
Type | Description |
---|---|
T |
Run()
Calls Do
Declaration
public virtual T Run()
Returns
Type | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
Lock |
if lock could not be obtained |