DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4418>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4418

Race Condition in net.serversocketfactory.java





------- Additional Comments From [EMAIL PROTECTED]  2001-10-25 18:09 -------
This is the double-check lock idiom, which is fatally flawed. 

q.v. : 
The "Double-Checked Locking is Broken" Declaration 
http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html

Can double-checked locking be fixed? 
No matter how you rig it, double-checked locking still fails 
http://www.javaworld.com/javaworld/jw-05-2001/jw-0525-double.html

theFactory should be initialized as a static, that is

private static ServerSocketFactory theFactory = new ServerSocketFactory();

either that, or the getDefault() method must be synchronised.

Reply via email to