mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-15 04:55:22 +02:00
[216252] canceled --> cancelled in comments
This commit is contained in:
parent
a2a2105997
commit
71fbaa7e47
2 changed files with 51 additions and 51 deletions
|
@ -48,17 +48,17 @@ public final class RSEInitJob extends Job {
|
||||||
private static RSEInitJob instance = new RSEInitJob();
|
private static RSEInitJob instance = new RSEInitJob();
|
||||||
|
|
||||||
private class Phase {
|
private class Phase {
|
||||||
private volatile boolean isCanceled = false;
|
private volatile boolean isCancelled = false;
|
||||||
private volatile boolean isComplete = false;
|
private volatile boolean isComplete = false;
|
||||||
private int phaseNumber = 0;
|
private int phaseNumber = 0;
|
||||||
public Phase(int phaseNumber) {
|
public Phase(int phaseNumber) {
|
||||||
this.phaseNumber = phaseNumber;
|
this.phaseNumber = phaseNumber;
|
||||||
}
|
}
|
||||||
public synchronized void waitForCompletion() throws InterruptedException {
|
public synchronized void waitForCompletion() throws InterruptedException {
|
||||||
while (!isComplete && !isCanceled) {
|
while (!isComplete && !isCancelled) {
|
||||||
wait();
|
wait();
|
||||||
}
|
}
|
||||||
if (isCanceled) {
|
if (isCancelled) {
|
||||||
throw new InterruptedException();
|
throw new InterruptedException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ public final class RSEInitJob extends Job {
|
||||||
notifyListeners(phaseNumber);
|
notifyListeners(phaseNumber);
|
||||||
}
|
}
|
||||||
public synchronized void cancel() {
|
public synchronized void cancel() {
|
||||||
isCanceled = true;
|
isCancelled = true;
|
||||||
notifyAll();
|
notifyAll();
|
||||||
}
|
}
|
||||||
public boolean isComplete() {
|
public boolean isComplete() {
|
||||||
|
|
|
@ -90,8 +90,8 @@ public class Mutex {
|
||||||
long timeLeft = timeout;
|
long timeLeft = timeout;
|
||||||
long pollTime = (monitor!=null) ? 1000 : timeLeft;
|
long pollTime = (monitor!=null) ? 1000 : timeLeft;
|
||||||
long nextProgressUpdate = start+500;
|
long nextProgressUpdate = start+500;
|
||||||
boolean canceled = false;
|
boolean cancelled = false;
|
||||||
while (timeLeft>0 && !canceled && !lockAcquired) {
|
while (timeLeft > 0 && !cancelled && !lockAcquired) {
|
||||||
//is it my turn yet? Check wait queue and wait
|
//is it my turn yet? Check wait queue and wait
|
||||||
synchronized(fWaitQueue) {
|
synchronized(fWaitQueue) {
|
||||||
if (!fLocked && fWaitQueue.get(0) == myself) {
|
if (!fLocked && fWaitQueue.get(0) == myself) {
|
||||||
|
@ -115,8 +115,8 @@ public class Mutex {
|
||||||
long curTime = System.currentTimeMillis();
|
long curTime = System.currentTimeMillis();
|
||||||
timeLeft = start + timeout - curTime;
|
timeLeft = start + timeout - curTime;
|
||||||
if (monitor!=null) {
|
if (monitor!=null) {
|
||||||
canceled = monitor.isCanceled();
|
cancelled = monitor.isCanceled();
|
||||||
if (!canceled && (curTime>nextProgressUpdate)) {
|
if (!cancelled && (curTime > nextProgressUpdate)) {
|
||||||
monitor.worked(1);
|
monitor.worked(1);
|
||||||
nextProgressUpdate+=1000;
|
nextProgressUpdate+=1000;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue