From e88262861a071173125aafcc853ee9ce45d3b03f Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Sat, 14 Jun 2014 17:45:43 +0900 Subject: [PATCH] Use FastThreadLocal in more places --- .../main/java/io/netty/util/internal/ThreadLocalRandom.java | 2 +- .../io/netty/util/internal/chmv8/ConcurrentHashMapV8.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/io/netty/util/internal/ThreadLocalRandom.java b/common/src/main/java/io/netty/util/internal/ThreadLocalRandom.java index 4413025370..a80a181fe9 100644 --- a/common/src/main/java/io/netty/util/internal/ThreadLocalRandom.java +++ b/common/src/main/java/io/netty/util/internal/ThreadLocalRandom.java @@ -207,7 +207,7 @@ public class ThreadLocalRandom extends Random { * The actual ThreadLocal */ private static final ThreadLocal localRandom = - new ThreadLocal() { + new FastThreadLocal() { protected ThreadLocalRandom initialValue() { return new ThreadLocalRandom(); } diff --git a/common/src/main/java/io/netty/util/internal/chmv8/ConcurrentHashMapV8.java b/common/src/main/java/io/netty/util/internal/chmv8/ConcurrentHashMapV8.java index dd791475c7..3e27a2f1df 100644 --- a/common/src/main/java/io/netty/util/internal/chmv8/ConcurrentHashMapV8.java +++ b/common/src/main/java/io/netty/util/internal/chmv8/ConcurrentHashMapV8.java @@ -22,6 +22,8 @@ package io.netty.util.internal.chmv8; +import io.netty.util.internal.FastThreadLocal; + import java.io.ObjectStreamField; import java.io.Serializable; import java.lang.reflect.ParameterizedType; @@ -6032,7 +6034,7 @@ public class ConcurrentHashMapV8 * Per-thread counter hash codes. Shared across all instances. */ static final ThreadLocal threadCounterHashCode = - new ThreadLocal(); + new FastThreadLocal(); final long sumCount() {