BAEL-7022 Why wait must be called in a synchronized block - Changing Boolean to primitive
Based on a comment.
This commit is contained in:
parent
331fb9a477
commit
7b5225e8db
@ -2,7 +2,7 @@ package com.baeldung.wait_synchronization;
|
||||
|
||||
public class ConditionChecker {
|
||||
|
||||
private volatile Boolean jobIsDone;
|
||||
private volatile boolean jobIsDone;
|
||||
private final Object lock = new Object();
|
||||
|
||||
public void ensureCondition() {
|
||||
@ -21,4 +21,4 @@ public class ConditionChecker {
|
||||
lock.notify();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user