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
This commit is contained in:
David Daney 2003-09-20 02:57:07 +00:00 committed by Tom Tromey
parent f55f60a5ea
commit 2f54a73fc1
2 changed files with 11 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2003-09-19 David Daney <ddaney@avtrex.com>
* java/lang/ref/Reference.java (clear): Set referent to null and
synchronize.
2003-09-19 Michael Koch <konqueror@gmx.de>
* gnu/java/nio/NIODatagramSocket.java,

View File

@ -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;
}
}
/**