Skip to content

Commit b4bddc6

Browse files
Anthony Xuke4qqq
authored andcommitted
timeInSeconds * 1000
timeInSeconds is int type, if timeInSeconds is very big, it makes "timeInseconds * 1000" very small even 0 (cherry picked from commit f5eae55)
1 parent 5c2094e commit b4bddc6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎framework/db/src/com/cloud/utils/db/Merovingian2.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public boolean acquire(String key, int timeInSeconds) {
120120
}
121121
long startTime = InaccurateClock.getTime();
122122

123-
while ((InaccurateClock.getTime() - startTime) < (timeInSeconds * 1000)) {
123+
while ((InaccurateClock.getTime() - startTime) < (timeInSeconds * 1000l)) {
124124
int count = owns(key);
125125

126126
if (count >= 1) {

0 commit comments

Comments
 (0)