summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2006-10-13 12:42:22 +0000
committerAndrew Haley <aph@redhat.com>2006-10-13 12:42:22 +0000
commit3e2c3a6cf9e3123f8e56634433724408f77f7a30 (patch)
tree393872d299b87e118ca9660c31cf2cc1951171ed
parent2799793789d5b66c90efbd1a3eb56e0c1ec57f88 (diff)
downloadclasspath-3e2c3a6cf9e3123f8e56634433724408f77f7a30.tar.gz
2006-10-12 Andrew Haley <aph@redhat.com>
* java/lang/InheritableThreadLocal.java: Rename NULL to sentinel. * java/lang/ThreadLocal.java: Likewise.
-rw-r--r--ChangeLog5
-rw-r--r--java/lang/InheritableThreadLocal.java4
-rw-r--r--java/lang/ThreadLocal.java8
3 files changed, 11 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index b60f4bc55..fc3686e81 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-10-12 Andrew Haley <aph@redhat.com>
+
+ * java/lang/InheritableThreadLocal.java: Rename NULL to sentinel.
+ * java/lang/ThreadLocal.java: Likewise.
+
2006-10-04 Roman Kennke <kennke@aicas.com>
* javax/swing/tree/VariableHeightLayoutCache.java
diff --git a/java/lang/InheritableThreadLocal.java b/java/lang/InheritableThreadLocal.java
index bbcbc0c2f..2079a4c20 100644
--- a/java/lang/InheritableThreadLocal.java
+++ b/java/lang/InheritableThreadLocal.java
@@ -107,12 +107,12 @@ public class InheritableThreadLocal<T> extends ThreadLocal<T>
{
InheritableThreadLocal local = (InheritableThreadLocal)key;
Object parentValue = parentThread.locals.get(key);
- Object childValue = local.childValue(parentValue == NULL
+ Object childValue = local.childValue(parentValue == sentinel
? null : parentValue);
if (childThread.locals == null)
childThread.locals = new WeakIdentityHashMap();
childThread.locals.put(key, (childValue == null
- ? NULL : childValue));
+ ? sentinel : childValue));
}
}
}
diff --git a/java/lang/ThreadLocal.java b/java/lang/ThreadLocal.java
index f599cfb44..6c4ba176a 100644
--- a/java/lang/ThreadLocal.java
+++ b/java/lang/ThreadLocal.java
@@ -93,7 +93,7 @@ public class ThreadLocal<T>
* user. Do not expose this to the public. Package visible for use by
* InheritableThreadLocal
*/
- static final Object NULL = new Object();
+ static final Object sentinel = new Object();
/**
* Creates a ThreadLocal object without associating any value to it yet.
@@ -132,9 +132,9 @@ public class ThreadLocal<T>
if (value == null)
{
value = initialValue();
- map.put(this, (T) (value == null ? NULL : value));
+ map.put(this, (T) (value == null ? sentinel : value));
}
- return value == (T) NULL ? null : value;
+ return value == (T) sentinel ? null : value;
}
/**
@@ -150,7 +150,7 @@ public class ThreadLocal<T>
Map map = Thread.getThreadLocals();
// Note that we don't have to synchronize, as only this thread will
// ever modify the map.
- map.put(this, value == null ? NULL : value);
+ map.put(this, value == null ? sentinel : value);
}
/**