Skip to content

Commit 2923255

Browse files
committed
Add convenience method to acquire read lock without timeout
1 parent 107ceea commit 2923255

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/java/io/pwrlabs/utils/PWRReentrantReadWriteLock.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,13 @@ public void acquireReadLock(int priority) throws InterruptedException {
201201
acquireReadLock(priority, Long.MAX_VALUE, TimeUnit.NANOSECONDS);
202202
}
203203

204+
/**
205+
* Convenience method - acquires read lock without timeout
206+
*/
207+
public void acquireReadLock() throws InterruptedException {
208+
acquireReadLock(PRIORITY_MEDIUM, Long.MAX_VALUE, TimeUnit.NANOSECONDS);
209+
}
210+
204211
/**
205212
* Releases the read lock.
206213
*/

0 commit comments

Comments
 (0)