From 8923edffdb36b790014ff47301e53f7ede93ea0d Mon Sep 17 00:00:00 2001 From: "Benjamin J. Culkin" Date: Wed, 11 Oct 2017 22:49:16 -0300 Subject: Cleanup more --- .../main/java/bjc/utils/funcutils/LambdaLock.java | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'base/src/main/java/bjc/utils/funcutils/LambdaLock.java') diff --git a/base/src/main/java/bjc/utils/funcutils/LambdaLock.java b/base/src/main/java/bjc/utils/funcutils/LambdaLock.java index 62c5d32..2506d53 100644 --- a/base/src/main/java/bjc/utils/funcutils/LambdaLock.java +++ b/base/src/main/java/bjc/utils/funcutils/LambdaLock.java @@ -10,15 +10,14 @@ import java.util.function.Supplier; * properly. * * @author EVE - * */ public class LambdaLock { - private final Lock readLock; - private final Lock writeLock; + /* The read lock. */ + private final Lock readLock; + /* The write lock. */ + private final Lock writeLock; - /** - * Create a new lambda-enabled lock around a new lock. - */ + /** Create a new lambda-enabled lock around a new lock. */ public LambdaLock() { this(new ReentrantReadWriteLock()); } @@ -27,7 +26,7 @@ public class LambdaLock { * Create a new lambda-enabled lock. * * @param lck - * The lock to wrap. + * The lock to wrap. */ public LambdaLock(final ReadWriteLock lck) { readLock = lck.readLock(); @@ -38,9 +37,10 @@ public class LambdaLock { * Execute an action with the read lock taken. * * @param supp - * The action to call. + * The action to call. * - * @return The result of the action. + * @return + * The result of the action. */ public T read(final Supplier supp) { readLock.lock(); @@ -56,9 +56,10 @@ public class LambdaLock { * Execute an action with the write lock taken. * * @param supp - * The action to call. + * The action to call. * - * @return The result of the action. + * @return + * The result of the action. */ public T write(final Supplier supp) { writeLock.lock(); @@ -74,8 +75,7 @@ public class LambdaLock { * Execute an action with the read lock taken. * * @param action - * The action to call. - * + * The action to call. */ public void read(final Runnable action) { readLock.lock(); @@ -91,7 +91,7 @@ public class LambdaLock { * Execute an action with the write lock taken. * * @param action - * The action to call. + * The action to call. */ public void write(final Runnable action) { writeLock.lock(); @@ -102,4 +102,4 @@ public class LambdaLock { writeLock.unlock(); } } -} \ No newline at end of file +} -- cgit v1.2.3