mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 07:09:56 +01:00
Don't swallow interrupts.
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user