C# 클래스 Lucene.Net.Store.Lock

An interprocess mutex lock.

Typical use might look like:

 new Lock.With(directory.makeLock("my.lock")) { public Object doBody() { ... code to execute while locked ... } }.run(); 
상속: IDisposable
파일 보기 프로젝트 열기: paulirwin/lucene.net 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
LOCK_POLL_INTERVAL long

공개 메소드들

메소드 설명
Dispose ( ) : void
Obtain ( ) : bool

Attempts to obtain exclusive access and immediately return upon success or failure. Use #close to release the lock.

Obtain ( long lockWaitTimeout ) : bool

Attempts to obtain an exclusive lock within amount of time given. Polls once per #LOCK_POLL_INTERVAL (currently 1000) milliseconds until lockWaitTimeout is passed.

Release ( ) : void

Releases exclusive access.

메소드 상세

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

Obtain() 공개 추상적인 메소드

Attempts to obtain exclusive access and immediately return upon success or failure. Use #close to release the lock.
public abstract Obtain ( ) : bool
리턴 bool

Obtain() 공개 메소드

Attempts to obtain an exclusive lock within amount of time given. Polls once per #LOCK_POLL_INTERVAL (currently 1000) milliseconds until lockWaitTimeout is passed.
if lock wait times out if lockWaitTimeout is /// out of bounds if obtain() throws System.IO.IOException
public Obtain ( long lockWaitTimeout ) : bool
lockWaitTimeout long length of time to wait in /// milliseconds or {@link /// #LOCK_OBTAIN_WAIT_FOREVER} to retry forever
리턴 bool

Release() 공개 추상적인 메소드

Releases exclusive access.
public abstract Release ( ) : void
리턴 void

프로퍼티 상세

LOCK_POLL_INTERVAL 공개적으로 정적으로 프로퍼티

How long #obtain(long) waits, in milliseconds, in between attempts to acquire the lock.
public static long LOCK_POLL_INTERVAL
리턴 long