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) {
|
||||
super.waitHere();
|
||||
continue;
|
||||
}
|
||||
if(isTimed) {
|
||||
long wt = timeLeft0();
|
||||
if(wt == 0) {
|
||||
unlock();
|
||||
return;
|
||||
}
|
||||
super.waitHere(wt);
|
||||
}
|
||||
else {
|
||||
super.waitHere();
|
||||
}
|
||||
} while(relocking);
|
||||
}
|
||||
|
||||
|
@ -87,14 +88,7 @@ public class Lock extends SimpleLock {
|
|||
do {
|
||||
long sectionOffset = System.currentTimeMillis() - start;
|
||||
|
||||
if(!isTimed) {
|
||||
long wt = timeout - sectionOffset;
|
||||
if(wt <= 0)
|
||||
return;
|
||||
super.waitHere(wt);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(isTimed) {
|
||||
long wt = timeLeft0();
|
||||
if(wt == 0) {
|
||||
unlock();
|
||||
|
@ -104,6 +98,13 @@ public class Lock extends SimpleLock {
|
|||
if(wt <= 0)
|
||||
return;
|
||||
super.waitHere(wt);
|
||||
}
|
||||
else {
|
||||
long wt = timeout - sectionOffset;
|
||||
if(wt <= 0)
|
||||
return;
|
||||
super.waitHere(wt);
|
||||
}
|
||||
} while(relocking);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue