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:
parent
f55f60a5ea
commit
2f54a73fc1
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user