public final class SdkThreadLocalsRegistry extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> ThreadLocal<T> |
register(ThreadLocal<T> threadLocal)
Registers
ThreadLocal objects in use by the COS SDK so that their values can
be removed via the remove() method. |
static void |
remove() |
public static <T> ThreadLocal<T> register(ThreadLocal<T> threadLocal)
ThreadLocal objects in use by the COS SDK so that their values can
be removed via the remove() method.
To avoid memory leaks and reduce contention this method should only be called when setting static final locations (for example finals in enums or static final fields).
threadLocal - ThreadLocal to registerpublic static void remove()
Copyright © 2021. All rights reserved.