public class VicariousThreadLocal<T> extends ThreadLocal<T>
ThreadLocal
implementation that does not leak
when thread-local values reference the ThreadLocal
object.
The code is optimised to cope with frequently changing values.
In comparison to plain ThreadLocal
, this implementation:ThreadLocal
Constructor and Description |
---|
VicariousThreadLocal()
Creates a new
VicariousThreadLocal . |
Modifier and Type | Method and Description |
---|---|
T |
get() |
void |
poll()
Check if any strong references need should be removed due to thread exit.
|
void |
remove() |
void |
set(T value) |
initialValue, withInitial
public VicariousThreadLocal()
VicariousThreadLocal
.public T get()
get
in class ThreadLocal<T>
public void set(T value)
set
in class ThreadLocal<T>
public void remove()
remove
in class ThreadLocal<T>
public void poll()
Copyright © 2003–2016 Terracotta, Inc.. All rights reserved.