diff options
author | David Daney <ddaney@avtrex.com> | 2003-09-20 02:57:07 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2003-09-20 02:57:07 +0000 |
commit | 2f54a73fc1a1466dbe576bfe0aab80cea9d4ff93 (patch) | |
tree | 599476f4a666c655364b56af95e2969aeb26d471 /libjava/java/lang/ref/Reference.java | |
parent | f55f60a5eab88e5692a6176f3407a91f2ba4f1f1 (diff) | |
download | gcc-2f54a73fc1a1466dbe576bfe0aab80cea9d4ff93.zip gcc-2f54a73fc1a1466dbe576bfe0aab80cea9d4ff93.tar.gz gcc-2f54a73fc1a1466dbe576bfe0aab80cea9d4ff93.tar.bz2 |
Reference.java (clear): Set referent to null and synchronize.
2003-09-19 David Daney <ddaney@avtrex.com>
* java/lang/ref/Reference.java (clear): Set referent to null and
synchronize.
From-SVN: r71597
Diffstat (limited to 'libjava/java/lang/ref/Reference.java')
-rw-r--r-- | libjava/java/lang/ref/Reference.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libjava/java/lang/ref/Reference.java b/libjava/java/lang/ref/Reference.java index 2f6235e..a6385a8 100644 --- a/libjava/java/lang/ref/Reference.java +++ b/libjava/java/lang/ref/Reference.java @@ -176,7 +176,12 @@ public abstract class Reference */ public void clear() { - cleared = true; + // Must synchronize so changes are visible in finalizer thread. + synchronized (lock) + { + referent = null; + cleared = true; + } } /** |