From: Tom Tromey Date: Tue, 26 Aug 2003 23:14:07 +0000 (+0000) Subject: StrictMath.java: Typo fix. X-Git-Tag: releases/gcc-3.4.0~4049 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=777bb1d4382ddc4aa8c5db3885e276874a470de8;p=thirdparty%2Fgcc.git StrictMath.java: Typo fix. * java/lang/StrictMath.java: Typo fix. * java/lang/Math.java: Typo fix. 2003-08-26 Stephen Crawley * java/lang/ThreadGroup.java (removeThread): null the 'group' field of the removed Thread. 2003-08-26 Mark Wielaard Reported by David Holmes . * java/lang/InheritableThreadLocal.java (threadMap): Wrap inside Collections.synchronizedMap. * java/lang/ThreadLocal.java (valueMap): Likewise. From-SVN: r70828 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index fdb5570956bb..c5f5066d8680 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,20 @@ +2003-08-26 Tom Tromey + + * java/lang/StrictMath.java: Typo fix. + * java/lang/Math.java: Typo fix. + +2003-08-26 Stephen Crawley + + * java/lang/ThreadGroup.java (removeThread): null the 'group' field + of the removed Thread. + +2003-08-26 Mark Wielaard + + Reported by David Holmes . + * java/lang/InheritableThreadLocal.java (threadMap): Wrap inside + Collections.synchronizedMap. + * java/lang/ThreadLocal.java (valueMap): Likewise. + 2003-08-26 Mark Wielaard * java/security/acl/Acl.java: Fix broken p tag. diff --git a/libjava/java/lang/InheritableThreadLocal.java b/libjava/java/lang/InheritableThreadLocal.java index 31b64f547980..5dfbe9a62308 100644 --- a/libjava/java/lang/InheritableThreadLocal.java +++ b/libjava/java/lang/InheritableThreadLocal.java @@ -1,5 +1,5 @@ /* InheritableThreadLocal -- a ThreadLocal which inherits values across threads - Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -37,9 +37,11 @@ exception statement from your version. */ package java.lang; +import java.util.ArrayList; +import java.util.Collections; import java.util.Iterator; import java.util.List; -import java.util.ArrayList; +import java.util.Map; import java.util.WeakHashMap; /** @@ -67,7 +69,8 @@ public class InheritableThreadLocal extends ThreadLocal * List can be collected, too. Maps to a list in case the user overrides * equals. */ - private static final WeakHashMap threadMap = new WeakHashMap(); + private static final Map threadMap + = Collections.synchronizedMap(new WeakHashMap()); /** * Creates a new InheritableThreadLocal that has no values associated @@ -77,7 +80,7 @@ public class InheritableThreadLocal extends ThreadLocal { Thread currentThread = Thread.currentThread(); // Note that we don't have to synchronize, as only this thread will - // ever modify the returned heritage. + // ever modify the returned heritage and threadMap is a synchronizedMap. List heritage = (List) threadMap.get(currentThread); if (heritage == null) { @@ -114,7 +117,7 @@ public class InheritableThreadLocal extends ThreadLocal // The currentThread is the parent of the new thread. Thread parentThread = Thread.currentThread(); // Note that we don't have to synchronize, as only this thread will - // ever modify the returned heritage. + // ever modify the returned heritage and threadMap is a synchronizedMap. ArrayList heritage = (ArrayList) threadMap.get(parentThread); if (heritage != null) { diff --git a/libjava/java/lang/Math.java b/libjava/java/lang/Math.java index 0d0930e8bf64..cb5f70b1cfbe 100644 --- a/libjava/java/lang/Math.java +++ b/libjava/java/lang/Math.java @@ -1,5 +1,5 @@ /* java.lang.Math -- common mathematical functions, native allowed - Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -521,7 +521,7 @@ public final class Math * double to x / y (ties go to the even n); for a zero * remainder, the sign is that of x. If either argument is NaN, * the first argument is infinite, or the second argument is zero, the result - * is NaN; if x is finite but y is infinte, the result is x. This is + * is NaN; if x is finite but y is infinite, the result is x. This is * accurate within the limits of doubles. * * @param x the dividend (the top half) diff --git a/libjava/java/lang/StrictMath.java b/libjava/java/lang/StrictMath.java index b47d89ca0409..bacc291faa5c 100644 --- a/libjava/java/lang/StrictMath.java +++ b/libjava/java/lang/StrictMath.java @@ -1,5 +1,5 @@ /* java.lang.StrictMath -- common mathematical functions, strict Java - Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. + Copyright (C) 1998, 2001, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -1053,7 +1053,7 @@ public final strictfp class StrictMath * double to x / y (ties go to the even n); for a zero * remainder, the sign is that of x. If either argument is NaN, * the first argument is infinite, or the second argument is zero, the result - * is NaN; if x is finite but y is infinte, the result is x. + * is NaN; if x is finite but y is infinite, the result is x. * * @param x the dividend (the top half) * @param y the divisor (the bottom half) diff --git a/libjava/java/lang/ThreadGroup.java b/libjava/java/lang/ThreadGroup.java index 80f62b6a7a77..b79c136dffe8 100644 --- a/libjava/java/lang/ThreadGroup.java +++ b/libjava/java/lang/ThreadGroup.java @@ -718,6 +718,7 @@ public class ThreadGroup if (groups == null) return; threads.remove(t); + t.group = null; // Daemon groups are automatically destroyed when all their threads die. if (daemon_flag && groups.size() == 0 && threads.size() == 0) { diff --git a/libjava/java/lang/ThreadLocal.java b/libjava/java/lang/ThreadLocal.java index b5877f51b6ac..972565949a8f 100644 --- a/libjava/java/lang/ThreadLocal.java +++ b/libjava/java/lang/ThreadLocal.java @@ -1,5 +1,5 @@ /* ThreadLocal -- a variable with a unique value per thread - Copyright (C) 2000, 2002 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -37,6 +37,7 @@ exception statement from your version. */ package java.lang; +import java.util.Collections; import java.util.Map; import java.util.WeakHashMap; @@ -101,7 +102,7 @@ public class ThreadLocal * set(Thread, Object) and get(Thread) methods * access it. Package visible for use by InheritableThreadLocal. */ - final Map valueMap = new WeakHashMap(); + final Map valueMap = Collections.synchronizedMap(new WeakHashMap()); /** * Creates a ThreadLocal object without associating any value to it yet. @@ -135,7 +136,7 @@ public class ThreadLocal { Thread currentThread = Thread.currentThread(); // Note that we don't have to synchronize, as only this thread will - // ever modify the returned value. + // ever modify the returned value and valueMap is a synchronizedMap. Object value = valueMap.get(currentThread); if (value == null) { @@ -156,7 +157,7 @@ public class ThreadLocal public void set(Object value) { // Note that we don't have to synchronize, as only this thread will - // ever modify the returned value. + // ever modify the returned value and valueMap is a synchronizedMap. valueMap.put(Thread.currentThread(), value == null ? NULL : value); } }