Package org.springframework.data.util
Interface ReadWriteLock
public interface ReadWriteLock
A
ReadWriteLock
maintains a pair of associated locks
, one for read-only operations and one for
writing. The read lock
may be held simultaneously by multiple reader threads, so long as there are
no writers. The write lock
is exclusive.- Since:
- 3.2
- Author:
- Mark Paluch
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic ReadWriteLock
of
(ReadWriteLock delegate) Create a newReadWriteLock
adapter for the givendelegate
.readLock()
Returns the lock used for reading.Returns the lock used for reading.
-
Method Details
-
of
Create a newReadWriteLock
adapter for the givendelegate
.- Parameters:
delegate
- must not be null.- Returns:
- a new
ReadWriteLock
adapter.
-
readLock
Lock readLock()Returns the lock used for reading.- Returns:
- the lock used for reading
- See Also:
-
writeLock
Lock writeLock()Returns the lock used for reading.- Returns:
- the lock used for writing.
- See Also:
-