Skip to content

Commit 82cbaa6

Browse files
committed
Made the lock object final
1 parent 2866ce4 commit 82cbaa6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/rampatra/threads/ProducerConsumerUsingWaitNotify.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class ProducerConsumerUsingWaitNotify {
1212
private static int currSize = 0;
1313
private static int totalSize = 10;
1414
private static int[] buffer = new int[totalSize];
15-
private static Object lock = new Object();
15+
private static final Object lock = new Object();
1616

1717
static class Producer {
1818
void produce() throws InterruptedException {

0 commit comments

Comments
 (0)