classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] [generics] Patch: FYI: ThreadLocal method


From: Tom Tromey
Subject: [cp-patches] [generics] Patch: FYI: ThreadLocal method
Date: 20 Apr 2005 14:19:58 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

I'm checking this in on the generics branch.

This adds a new method to ThreadLocal.

Tom

2005-04-19  Tom Tromey  <address@hidden>

        * java/lang/ThreadLocal.java (remove): New method.

Index: java/lang/ThreadLocal.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/lang/ThreadLocal.java,v
retrieving revision 1.4.2.3
diff -u -r1.4.2.3 ThreadLocal.java
--- java/lang/ThreadLocal.java 13 Mar 2005 14:38:40 -0000 1.4.2.3
+++ java/lang/ThreadLocal.java 20 Apr 2005 20:15:29 -0000
@@ -1,5 +1,5 @@
 /* ThreadLocal -- a variable with a unique value per thread
-   Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
 
@@ -85,7 +85,7 @@
  * @author Mark Wielaard (address@hidden)
  * @author Eric Blake (address@hidden)
  * @since 1.2
- * @status updated to 1.4
+ * @status updated to 1.5
  */
 public class ThreadLocal<T>
 {
@@ -169,4 +169,15 @@
     // ever modify the map.
     map.put(key, value == null ? NULL : value);
   }
+
+  /**
+   * Removes the value associated with the ThreadLocal object for the
+   * currently executing Thread.
+   * @since 1.5
+   */
+  public void remove()
+  {
+    Map map = Thread.getThreadLocals();
+    map.remove(key);
+  }
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]