Don't swallow interrupts.

This commit is contained in:
akwizgran
2011-12-01 19:49:22 +00:00
parent 2a38efd13a
commit 28b9e399ae
15 changed files with 18 additions and 42 deletions

View File

@@ -2,9 +2,6 @@ package net.sf.briar.transport;
import static net.sf.briar.api.transport.TransportConstants.MAX_FRAME_LENGTH;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* A thread that calls the writeFullFrame() method of a PaddedConnectionWriter
* at regular intervals. The interval between calls is determined by a target
@@ -13,9 +10,6 @@ import java.util.logging.Logger;
*/
class FrameScheduler extends Thread {
private static final Logger LOG =
Logger.getLogger(FrameScheduler.class.getName());
private final PaddedConnectionWriter writer;
private final int millisPerFrame;
@@ -34,8 +28,7 @@ class FrameScheduler extends Thread {
try {
Thread.sleep(nextCall - now);
} catch(InterruptedException e) {
if(LOG.isLoggable(Level.WARNING))
LOG.warning(e.getMessage());
Thread.currentThread().interrupt();
}
}
lastCall = System.currentTimeMillis();

View File

@@ -108,7 +108,7 @@ class PaddedConnectionWriter extends ConnectionWriterImpl {
try {
wait();
} catch(InterruptedException e) {
throw new IOException(e.getMessage());
Thread.currentThread().interrupt();
}
if(exception != null) throw exception;
}

View File

@@ -218,8 +218,7 @@ abstract class StreamConnection implements DatabaseListener {
try {
wait();
} catch(InterruptedException e) {
if(LOG.isLoggable(Level.WARNING))
LOG.warning(e.getMessage());
Thread.currentThread().interrupt();
}
}
flags = writerFlags;
@@ -258,8 +257,7 @@ abstract class StreamConnection implements DatabaseListener {
try {
wait();
} catch(InterruptedException e) {
if(LOG.isLoggable(Level.WARNING))
LOG.warning(e.getMessage());
Thread.currentThread().interrupt();
}
}
flags = writerFlags;