forked from I2P_Developers/i2p.i2p
more static atomics
This commit is contained in:
@ -3,6 +3,7 @@ package net.i2p.client;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
import net.i2p.data.Destination;
|
||||
@ -31,11 +32,11 @@ class MessageState {
|
||||
private boolean _cancelled;
|
||||
private final long _created;
|
||||
|
||||
private static long __stateId = 0;
|
||||
private long _stateId;
|
||||
private static final AtomicLong __stateId = new AtomicLong();
|
||||
private final long _stateId;
|
||||
|
||||
public MessageState(I2PAppContext ctx, long nonce, String prefix) {
|
||||
_stateId = ++__stateId;
|
||||
_stateId = __stateId.incrementAndGet();
|
||||
_context = ctx;
|
||||
_log = ctx.logManager().getLog(MessageState.class);
|
||||
_nonce = nonce;
|
||||
|
@ -24,6 +24,7 @@ import java.util.Set;
|
||||
import java.util.TimeZone;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
import net.i2p.I2PAppContext;
|
||||
@ -738,11 +739,12 @@ public class LogManager {
|
||||
_consoleBuffer.clear();
|
||||
}
|
||||
|
||||
private static int __id = 0;
|
||||
private static final AtomicInteger __id = new AtomicInteger();
|
||||
|
||||
private class ShutdownHook extends Thread {
|
||||
private int _id;
|
||||
private final int _id;
|
||||
public ShutdownHook() {
|
||||
_id = ++__id;
|
||||
_id = __id.incrementAndGet();
|
||||
}
|
||||
@Override
|
||||
public void run() {
|
||||
|
Reference in New Issue
Block a user