ice.util.alg
Class ThreadVar
java.lang.Object
ice.util.alg.ThreadVar
- public class ThreadVar
- extends Object
Access to java.lang.ThreadLocal and its get/set methods from jdk 1.2
or its emulation under jdk 1.1
You always use push/restore methods like that:
private static final ThreadVar MY_KEY = ThreadVar.create();
...
Object saved = MY_KEY.push(new_value);
try {
...
} finally {
MY_KEY.restore(saved);
}
Violation of this strict rule will lead to memory leaks under JDK 1.1.
The usage of the get method is unrestricted.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThreadVar
protected ThreadVar()
create
public static ThreadVar create()
get
public Object get()
push
public Object push(Object new_value)
restore
public void restore(Object old_value)
newInstance
protected ThreadVar newInstance()