public final class AttachmentThreadUtils extends Object
| Constructor and Description |
|---|
AttachmentThreadUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
get(int index) |
static <T> T |
getOrUpdate(int index,
Supplier<T> producer) |
static int |
nextVarIndex()
寻找下一个线程本地变量位置
|
static <T> void |
put(int index,
T value) |
public static int nextVarIndex()
public static <T> T getOrUpdate(int index,
Supplier<T> producer)
index - 通过 nextVarIndex() 获得producer - 尽量使用final常量以获得更好的性能public static <T> T get(int index)
index - 通过 nextVarIndex() 获得public static <T> void put(int index,
T value)
index - 通过 nextVarIndex() 获得Copyright © 2019. All rights reserved.