Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

Commit 2f9ca87

Browse files
committed
Fix inconsistent synchronization
1 parent 616183c commit 2f9ca87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fenzo-core/src/main/java/com/netflix/fenzo/AssignableVMs.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ synchronized boolean reject() {
4848
lastRejectAt = System.currentTimeMillis();
4949
return true;
5050
}
51-
boolean limitReached() {
51+
synchronized boolean limitReached() {
5252
return rejectedCount == limit;
5353
}
54-
private void reset() {
54+
private synchronized void reset() {
5555
if(System.currentTimeMillis() > (lastRejectAt + rejectDelay))
5656
rejectedCount=0;
5757
}

0 commit comments

Comments
 (0)