atomic default value cleanup

This commit is contained in:
zzz
2013-09-24 14:45:30 +00:00
parent fb40ab1f00
commit fdf38a952d
5 changed files with 8 additions and 7 deletions

View File

@@ -70,7 +70,7 @@ class Connection {
/** Notify this on connection (or connection failure) */ /** Notify this on connection (or connection failure) */
private final Object _connectLock; private final Object _connectLock;
/** how many messages have been resent and not yet ACKed? */ /** how many messages have been resent and not yet ACKed? */
private final AtomicInteger _activeResends = new AtomicInteger(0); private final AtomicInteger _activeResends = new AtomicInteger();
private final ConEvent _connectionEvent; private final ConEvent _connectionEvent;
private final int _randomWait; private final int _randomWait;
private int _localPort; private int _localPort;
@@ -565,6 +565,7 @@ class Connection {
void disconnect(boolean cleanDisconnect) { void disconnect(boolean cleanDisconnect) {
disconnect(cleanDisconnect, true); disconnect(cleanDisconnect, true);
} }
void disconnect(boolean cleanDisconnect, boolean removeFromConMgr) { void disconnect(boolean cleanDisconnect, boolean removeFromConMgr) {
synchronized (_connectLock) { _connectLock.notifyAll(); } synchronized (_connectLock) { _connectLock.notifyAll(); }
if (_log.shouldLog(Log.DEBUG)) if (_log.shouldLog(Log.DEBUG))

View File

@@ -21,7 +21,7 @@ class I2PSocketFull implements I2PSocket {
private final Destination _remotePeer; private final Destination _remotePeer;
private final Destination _localPeer; private final Destination _localPeer;
private volatile MessageChannel _channel; private volatile MessageChannel _channel;
private final AtomicBoolean _closed = new AtomicBoolean(false); private final AtomicBoolean _closed = new AtomicBoolean();
public I2PSocketFull(Connection con, I2PAppContext context) { public I2PSocketFull(Connection con, I2PAppContext context) {
log = context.logManager().getLog(I2PSocketFull.class); log = context.logManager().getLog(I2PSocketFull.class);

View File

@@ -38,9 +38,9 @@ public class I2PSocketManagerFull implements I2PSocketManager {
private final ConnectionOptions _defaultOptions; private final ConnectionOptions _defaultOptions;
private long _acceptTimeout; private long _acceptTimeout;
private String _name; private String _name;
private static final AtomicInteger __managerId = new AtomicInteger(0); private static final AtomicInteger __managerId = new AtomicInteger();
private final ConnectionManager _connectionManager; private final ConnectionManager _connectionManager;
private final AtomicBoolean _isDestroyed = new AtomicBoolean(false); private final AtomicBoolean _isDestroyed = new AtomicBoolean();
/** /**
* How long to wait for the client app to accept() before sending back CLOSE? * How long to wait for the client app to accept() before sending back CLOSE?

View File

@@ -26,8 +26,8 @@ class MessageOutputStream extends OutputStream {
private int _valid; private int _valid;
private final Object _dataLock; private final Object _dataLock;
private final DataReceiver _dataReceiver; private final DataReceiver _dataReceiver;
private final AtomicReference<IOException>_streamError = new AtomicReference<IOException>(null); private final AtomicReference<IOException>_streamError = new AtomicReference<IOException>();
private final AtomicBoolean _closed = new AtomicBoolean(false); private final AtomicBoolean _closed = new AtomicBoolean();
private long _written; private long _written;
private int _writeTimeout; private int _writeTimeout;
private ByteCache _dataCache; private ByteCache _dataCache;

View File

@@ -30,7 +30,7 @@ class PacketLocal extends Packet implements MessageOutputStream.WriteStatus {
/** LOCKING: this */ /** LOCKING: this */
private long _ackOn; private long _ackOn;
private long _cancelledOn; private long _cancelledOn;
private final AtomicInteger _nackCount = new AtomicInteger(0); private final AtomicInteger _nackCount = new AtomicInteger();
private volatile boolean _retransmitted; private volatile boolean _retransmitted;
private volatile SimpleTimer2.TimedEvent _resendEvent; private volatile SimpleTimer2.TimedEvent _resendEvent;