diff options
Diffstat (limited to 'java/src/IceSSL/SslTransceiver.java')
-rw-r--r-- | java/src/IceSSL/SslTransceiver.java | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/java/src/IceSSL/SslTransceiver.java b/java/src/IceSSL/SslTransceiver.java index 080ceb5b1e4..2ab87607dbd 100644 --- a/java/src/IceSSL/SslTransceiver.java +++ b/java/src/IceSSL/SslTransceiver.java @@ -26,18 +26,23 @@ final class SslTransceiver implements IceInternal.Transceiver _logger.trace(_instance.networkTraceCategory(), s); } - assert(_fd != null); - try - { - _fd.close(); - _fd = null; - } - catch(java.io.IOException ex) + synchronized(this) { - _fd = null; - Ice.SocketException se = new Ice.SocketException(); - se.initCause(ex); - throw se; + assert(_fd != null); + try + { + _fd.close(); + } + catch(java.io.IOException ex) + { + Ice.SocketException se = new Ice.SocketException(); + se.initCause(ex); + throw se; + } + finally + { + _fd = null; + } } } @@ -331,7 +336,7 @@ final class SslTransceiver implements IceInternal.Transceiver _shutdown = false; } - protected void + protected synchronized void finalize() throws Throwable { |