tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 61810] [Proposal] Support configure the interval to keep all jars open if no jar is accessed
Date Wed, 20 Dec 2017 06:43:20 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=61810

--- Comment #8 from Huxing Zhang <huxing.zhang@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message