P
puzzlecracker
It is a copy and paste from Doug Lea's Mutex implementation. I dont
understand the point of this line:
if (Thread.interrupted()) throw new InterruptedException();
public void acquire() throws InterruptedException {
if (Thread.interrupted()) throw new InterruptedException();
synchronized(this) {
try {
while (inuse_) wait();
inuse_ = true;
}
catch (InterruptedException ex) {
notify();
throw ex;
}
}
}
Thx
understand the point of this line:
if (Thread.interrupted()) throw new InterruptedException();
public void acquire() throws InterruptedException {
if (Thread.interrupted()) throw new InterruptedException();
synchronized(this) {
try {
while (inuse_) wait();
inuse_ = true;
}
catch (InterruptedException ex) {
notify();
throw ex;
}
}
}
Thx