Use FastThreadLocal in more places
This commit is contained in:
parent
de2872f7f7
commit
fb5464a544
@ -16,6 +16,7 @@
|
||||
|
||||
package io.netty.handler.codec;
|
||||
|
||||
import io.netty.util.internal.FastThreadLocal;
|
||||
import io.netty.util.internal.PlatformDependent;
|
||||
|
||||
import java.text.DateFormat;
|
||||
@ -769,7 +770,7 @@ public class DefaultTextHeaders implements TextHeaders {
|
||||
|
||||
private static final ParsePosition parsePos = new ParsePosition(0);
|
||||
private static final ThreadLocal<HttpHeaderDateFormat> dateFormatThreadLocal =
|
||||
new ThreadLocal<HttpHeaderDateFormat>() {
|
||||
new FastThreadLocal<HttpHeaderDateFormat>() {
|
||||
@Override
|
||||
protected HttpHeaderDateFormat initialValue() {
|
||||
return new HttpHeaderDateFormat();
|
||||
|
@ -207,7 +207,7 @@ public class ThreadLocalRandom extends Random {
|
||||
* The actual ThreadLocal
|
||||
*/
|
||||
private static final ThreadLocal<ThreadLocalRandom> localRandom =
|
||||
new ThreadLocal<ThreadLocalRandom>() {
|
||||
new FastThreadLocal<ThreadLocalRandom>() {
|
||||
protected ThreadLocalRandom initialValue() {
|
||||
return new ThreadLocalRandom();
|
||||
}
|
||||
|
@ -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<K,V>
|
||||
* Per-thread counter hash codes. Shared across all instances.
|
||||
*/
|
||||
static final ThreadLocal<CounterHashCode> threadCounterHashCode =
|
||||
new ThreadLocal<CounterHashCode>();
|
||||
new FastThreadLocal<CounterHashCode>();
|
||||
|
||||
|
||||
final long sumCount() {
|
||||
|
Loading…
Reference in New Issue
Block a user