https://bz.apache.org/bugzilla/show_bug.cgi?id=61810

--- Comment #8 from Huxing Zhang <huxing.zh...@gmail.com> ---
(In reply to Konstantin Kolinko from comment #6)
> > 2197        synchronized (jarFiles) {
> > 2198           if (force || (jarOpenInterval > 0 && 
> > System.currentTimeMillis()
> > 2199                                    > (lastJarAccessed + 
> > jarOpenInterval))) {
> 
> The above lines can be additionally wrapped with "if (force ||
> (jarOpenInterval > 0))", to avoid wasting time on "synchronized (jarFiles)"
> when jarOpenInterval is negative (the jar closing feature is turned off).

Do mean sth. like this?

if (jarFiles.length > 0 && (force || jarOpenInterval > 0)) {
    synchronized (jarFiles) {
        if (force || (jarOpenInterval > 0 && System.currentTimeMillis()
                                  > (lastJarAccessed + jarOpenInterval))) {
            ...
        }
    }
}

If so, yes, I think it is better, I will take that.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to