[review] [#3506] PR reviewed; passes review and passes tests.

This commit is contained in:
Reinier Zwitserloot committed 2023-09-25 06:19:36 +02:00
1 parent 567b098e99
commit 566f01be47
38 files changed
+406 -371

No files matched your search

@@ -1,8 +1,8 @@
public class LockedExample {
private final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
private final ReentrantLock baseLock = new ReentrantLock();
private final ReadWriteLock lock = new ReentrantReadWriteLock();
private final Lock baseLock = new ReentrantLock();
private int value = 0;
public int getValue() {
this.lock.readLock().lock();
try {
@@ -11,7 +11,7 @@ public class LockedExample {
this.lock.readLock().unlock();
}
}
public void setValue(int newValue) {
this.lock.writeLock().lock();
try {
@@ -20,7 +20,7 @@ public class LockedExample {
this.lock.writeLock().unlock();
}
}
public void foo() {
this.baseLock.lock();
try {
@@ -1,18 +1,18 @@
import lombok.experimental.Locked;
import lombok.Locked;
public class LockedExample {
private int value = 0;
@Locked.Read
public int getValue() {
return value;
}
@Locked.Write
public void setValue(int newValue) {
value = newValue;
}
@Locked("baseLock")
public void foo() {
System.out.println("bar");