Skip to content

Commit 1feacdd

Browse files
committed
Flaky build due to a possible race condition #1449
Signed-off-by: christian.lutnik <[email protected]>
1 parent 5ab1f68 commit 1feacdd

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

src/main/java/dev/openfeature/sdk/Awaitable.java

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,12 @@ private Awaitable(boolean isDone) {
2020
* immediately.
2121
*/
2222
@SuppressWarnings("java:S2142")
23-
public void await() {
24-
if (isDone) {
25-
return;
26-
}
27-
synchronized (this) {
28-
while (!isDone) {
29-
try {
30-
this.wait();
31-
} catch (InterruptedException ignored) {
32-
// ignored, do not propagate the interrupted state
33-
}
23+
public synchronized void await() {
24+
while (!isDone) {
25+
try {
26+
this.wait();
27+
} catch (InterruptedException ignored) {
28+
// ignored, do not propagate the interrupted state
3429
}
3530
}
3631
}

0 commit comments

Comments
 (0)