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

http://issues.apache.org/bugzilla/show_bug.cgi?id=41706





------- Additional Comments From [EMAIL PROTECTED]  2007-02-26 12:20 -------
Oh, wait. I'm sorry.

I think that since this piece of code calls a method to instantiate and
initialize the "instance" member, it turns out that this is actually NOT a bug.

You can even avoid the synchronized block, since the loadServlet method itself
is synchronized, and uses only local variables.

My recommendation would be to document the code to mention DCL and why it's
still safe to do in this case, remove the synchronization within the allocate()
method, or both.

This code will be functionally the same as the existing code:
            // Load and initialize our instance if necessary
            if (instance == null) {
                try {
                    if (log.isDebugEnabled())
                        log.debug("Allocating non-STM instance");

                    instance = loadServlet();
                } catch (ServletException e) {
                    throw e;
                } catch (Throwable e) {
                    throw new ServletException
                        (sm.getString("standardWrapper.allocate"), e);
                }
            }


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to