This commit is contained in:
parent
909d95be09
commit
85f90ce11b
1 changed files with 21 additions and 20 deletions
|
@ -60,16 +60,17 @@ public class Lock extends SimpleLock {
|
|||
return;
|
||||
|
||||
do {
|
||||
if(!isTimed) {
|
||||
if(isTimed) {
|
||||
long wt = timeLeft0();
|
||||
if(wt == 0) {
|
||||
unlock();
|
||||
return;
|
||||
}
|
||||
super.waitHere(wt);
|
||||
}
|
||||
else {
|
||||
super.waitHere();
|
||||
continue;
|
||||
}
|
||||
long wt = timeLeft0();
|
||||
if(wt == 0) {
|
||||
unlock();
|
||||
return;
|
||||
}
|
||||
super.waitHere(wt);
|
||||
} while(relocking);
|
||||
}
|
||||
|
||||
|
@ -87,23 +88,23 @@ public class Lock extends SimpleLock {
|
|||
do {
|
||||
long sectionOffset = System.currentTimeMillis() - start;
|
||||
|
||||
if(!isTimed) {
|
||||
if(isTimed) {
|
||||
long wt = timeLeft0();
|
||||
if(wt == 0) {
|
||||
unlock();
|
||||
return;
|
||||
}
|
||||
wt = Math.min(wt, timeout - sectionOffset);
|
||||
if(wt <= 0)
|
||||
return;
|
||||
super.waitHere(wt);
|
||||
}
|
||||
else {
|
||||
long wt = timeout - sectionOffset;
|
||||
if(wt <= 0)
|
||||
return;
|
||||
super.waitHere(wt);
|
||||
continue;
|
||||
}
|
||||
|
||||
long wt = timeLeft0();
|
||||
if(wt == 0) {
|
||||
unlock();
|
||||
return;
|
||||
}
|
||||
wt = Math.min(wt, timeout - sectionOffset);
|
||||
if(wt <= 0)
|
||||
return;
|
||||
super.waitHere(wt);
|
||||
} while(relocking);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue