使用TreadPool时的ThreadLocal示例
转载,原文链接:http://www.cnblogs.com/goofy/archive/2011/11/11/2245907.html
?
???public voidset(T value) {
???????Thread t = Thread.currentThread();
???????ThreadLocalMap map = getMap(t);
???????if (map!= null)
???????????map.set(this, value);
???????else
???????????createMap(t, value);
}
?}