Minor concurrency cleanups.

This commit is contained in:
akwizgran
2011-10-12 17:11:31 +01:00
parent 3a07d1b882
commit c5d9d9fa64
2 changed files with 20 additions and 23 deletions

View File

@@ -85,8 +85,8 @@ implements StreamTransportPlugin {
}
socket = ss;
setLocalSocketAddress(ss.getLocalSocketAddress());
startListener();
}
startListener();
}
private void startListener() {
@@ -103,7 +103,7 @@ implements StreamTransportPlugin {
ServerSocket ss;
Socket s;
synchronized(this) {
if(!started || socket == null) return;
if(!started) return;
ss = socket;
}
try {
@@ -120,10 +120,7 @@ implements StreamTransportPlugin {
@Override
public synchronized void stop() throws IOException {
super.stop();
if(socket != null) {
socket.close();
socket = null;
}
if(socket != null) socket.close();
}
public synchronized void poll() {