tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Duplicate code in AccessLogValve
Date Fri, 19 Jun 2009 15:12:17 GMT
On 19/06/2009, Xie Xiaodong <xxd82329@gmail.com> wrote:
> No, I think line767 is still needed. You could turn to the last part of this
>  article for reference: "
>  http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html".

Oops, my bad.
The code would still work, but it would sometimes create a new Date
unecessarily.

>
>
>  2009/6/19 sebb <sebbaz@gmail.com>
>
>
>  > On 19/06/2009, sebb <sebbaz@gmail.com> wrote:
>  > > Just spotted this duplicate code in AccessLogValve:
>  > >
>  > >  661:                        if (!dateStamp.equals(tsDate)) {
>  > >  662:                            if (!dateStamp.equals(tsDate)) {
>  > >
>  > >  Not sure this double-checked looking offers any benefit ;-)
>  > >
>  >
>  > Line 767 is also no longer needed, as currentMillis is now volatile:
>  >
>  > 765:        if ((systime - currentMillis) > 1000) {
>  > 766:            synchronized (this) {
>  > 767:                if ((systime - currentMillis) > 1000) {
>  >
>
> > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>  > For additional commands, e-mail: dev-help@tomcat.apache.org
>  >
>  >
>
>
>  --
>  Sincerely yours and Best Regards,
>
> Xie Xiaodong
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message