From 143145daa42382453636fb24b705c673ee812e37 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 13 May 2006 02:16:22 +0000 Subject: sources.am, [...]: Rebuilt. * sources.am, Makefile.in: Rebuilt. * java/util/logging/LogManager.java: Removed. * java/util/logging/Logger.java (resetLogger): New method, from Classpath. * java/io/RandomAccessFile.java: Removed. * gnu/java/nio/channels/FileChannelImpl.java (create): New method. (FileChannelImpl): Now private. * java/io/FileInputStream.java: Removed. * java/io/FileOutputStream.java: Removed. * java/security/AccessControlContext.java: Removed. * java/lang/ThreadLocal.java: Removed. * java/lang/InheritableThreadLocal.java: Removed. * java/lang/Thread.java (locals): New field. (getThreadLocals): New method. * java/lang/natThread.cc (finish_): Clear 'locals'. From-SVN: r113735 --- libjava/java/lang/Thread.java | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'libjava/java/lang/Thread.java') diff --git a/libjava/java/lang/Thread.java b/libjava/java/lang/Thread.java index fc07f2bbd37..7938498ed49 100644 --- a/libjava/java/lang/Thread.java +++ b/libjava/java/lang/Thread.java @@ -1,5 +1,5 @@ /* Thread -- an independent thread of executable code - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation This file is part of GNU Classpath. @@ -41,6 +41,8 @@ package java.lang; import gnu.gcj.RawData; import gnu.gcj.RawDataManaged; +import gnu.java.util.WeakIdentityHashMap; +import java.util.Map; /* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3 * "The Java Language Specification", ISBN 0-201-63451-1 @@ -125,6 +127,11 @@ public class Thread implements Runnable /** The context classloader for this Thread. */ private ClassLoader contextClassLoader; + /** Thread local storage. Package accessible for use by + * InheritableThreadLocal. + */ + WeakIdentityHashMap locals; + // This describes the top-most interpreter frame for this thread. RawData interp_frame; @@ -914,4 +921,18 @@ public class Thread implements Runnable private final native void initialize_native(); private final native static String gen_name(); + + /** + * Returns the map used by ThreadLocal to store the thread local values. + */ + static Map getThreadLocals() + { + Thread thread = currentThread(); + Map locals = thread.locals; + if (locals == null) + { + locals = thread.locals = new WeakIdentityHashMap(); + } + return locals; + } } -- cgit v1.2.3