improve code quality a bit
Some checks failed
/ Build & Publish (push) Failing after 41s

This commit is contained in:
Daniella / Tove 2024-06-25 05:51:31 +02:00
parent 909d95be09
commit 85f90ce11b
Signed by: TudbuT
GPG key ID: B3CF345217F202D3

View file

@ -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);
}