admin 管理员组

文章数量: 887021


2024年2月19日发(作者:netstat监控上网记录)

public class ThreadLocal {

public void set(T value) {

Thread t = tThread();

ThreadLocalMap map = getMap(t);

if (map != null)

(this, value);

else

createMap(t, value);

}

public T get() {

Thread t = tThread();

ThreadLocalMap map = getMap(t);

if (map != null) {

e = ry(this);

if (e != null)

return (T);

}

return setInitialValue();

}

ThreadLocalMap getMap(Thread t) {

return Locals;

}

}

Thread类的部分代码:public class Thread implements Runnable {

LocalMap threadLocals = null;

......................

.........................

static class ThreadLocalMap { //ThreadLocalMap为Thread类的内部类

}

}


本文标签: 监控 上网 部分 代码 记录