Class ManagedReadWriteLock
java.lang.Object
com.espertech.esper.common.internal.util.ManagedReadWriteLock
Simple read-write lock based on
ReentrantReadWriteLock
that associates a
name with the lock and traces read/write locking and unlocking.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Lock read lock.void
Lock write lock.getLock()
void
Unlock read lock.void
Unlock write lock.boolean
tryWriteLock
(long msec) Try write lock with timeout, returning an indicator whether the lock was acquired or not.
-
Field Details
-
ACQUIRE_TEXT
Acquire text.- See Also:
-
ACQUIRED_TEXT
Acquired text.- See Also:
-
TRY_TEXT
Acquired text.- See Also:
-
RELEASE_TEXT
Release text.- See Also:
-
RELEASED_TEXT
Released text.- See Also:
-
-
Constructor Details
-
ManagedReadWriteLock
Ctor.- Parameters:
name
- of lockisFair
- true if a fair lock, false if not
-
-
Method Details
-
acquireWriteLock
public void acquireWriteLock()Lock write lock. -
tryWriteLock
public boolean tryWriteLock(long msec) Try write lock with timeout, returning an indicator whether the lock was acquired or not.- Parameters:
msec
- number of milliseconds to wait for lock- Returns:
- indicator whether the lock could be acquired or not
-
releaseWriteLock
public void releaseWriteLock()Unlock write lock. -
acquireReadLock
public void acquireReadLock()Lock read lock. -
releaseReadLock
public void releaseReadLock()Unlock read lock. -
getLock
-