1 |
/* ThreadLocal -- a variable with a unique value per thread |
/* ThreadLocal -- a variable with a unique value per thread |
2 |
Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc. |
Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
85 |
* @author Mark Wielaard (mark@klomp.org) |
* @author Mark Wielaard (mark@klomp.org) |
86 |
* @author Eric Blake (ebb9@email.byu.edu) |
* @author Eric Blake (ebb9@email.byu.edu) |
87 |
* @since 1.2 |
* @since 1.2 |
88 |
* @status updated to 1.4 |
* @status updated to 1.5 |
89 |
*/ |
*/ |
90 |
public class ThreadLocal<T> |
public class ThreadLocal<T> |
91 |
{ |
{ |
169 |
// ever modify the map. |
// ever modify the map. |
170 |
map.put(key, value == null ? NULL : value); |
map.put(key, value == null ? NULL : value); |
171 |
} |
} |
172 |
|
|
173 |
|
/** |
174 |
|
* Removes the value associated with the ThreadLocal object for the |
175 |
|
* currently executing Thread. |
176 |
|
* @since 1.5 |
177 |
|
*/ |
178 |
|
public void remove() |
179 |
|
{ |
180 |
|
Map map = Thread.getThreadLocals(); |
181 |
|
map.remove(key); |
182 |
|
} |
183 |
} |
} |