diff -r dde3fe2e8164 src/share/classes/java/util/logging/LogRecord.java --- a/src/share/classes/java/util/logging/LogRecord.java Wed Feb 25 14:32:01 2009 +0000 +++ b/src/share/classes/java/util/logging/LogRecord.java Thu Mar 12 17:12:22 2009 -0500 @@ -25,6 +25,8 @@ package java.util.logging; import java.util.*; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicInteger; import java.io.*; /** @@ -64,9 +66,9 @@ */ public class LogRecord implements java.io.Serializable { - private static long globalSequenceNumber; - private static int nextThreadId=10; - private static ThreadLocal threadIds = new ThreadLocal(); + private static final AtomicLong globalSequenceNumber = new AtomicLong(); + private static final AtomicInteger nextThreadId = new AtomicInteger(10); + private static final ThreadLocal threadIds = new ThreadLocal(); /** * @serial Logging message level @@ -144,15 +146,13 @@ this.level = level; message = msg; // Assign a thread ID and a unique sequence number. - synchronized (LogRecord.class) { - sequenceNumber = globalSequenceNumber++; - Integer id = threadIds.get(); - if (id == null) { - id = new Integer(nextThreadId++); - threadIds.set(id); - } - threadID = id.intValue(); + sequenceNumber = globalSequenceNumber.getAndIncrement(); + Integer id = threadIds.get(); + if (id == null) { + id = Integer.valueOf(nextThreadId.getAndIncrement()); + threadIds.set(id); } + threadID = id.intValue(); millis = System.currentTimeMillis(); needToInferCaller = true; }