cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vadim.gritse...@verizon.net>
Subject RE: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/sitemap ContentAggregator.java
Date Tue, 23 Jul 2002 03:00:49 GMT
> From: tcurdt@apache.org [mailto:tcurdt@apache.org]
> 
> tcurdt      2002/07/22 19:04:30
> 
>   Modified:    src/java/org/apache/cocoon/sitemap
ContentAggregator.java
>   Log:
>   fixed a raise condition

You mean race condition.

But, ContentAggregator is Recyclable, which means that it is Poolable,
which means that it is allowed to be accessed by one thread only,
*especially* in lifecycle methods (AFAIU Avalon - am I right?).


If you observe several threads in recycle() at once, it means that
something is *really* wrong somewhere, and it is better to find reason
of the real problem then mask its consequences.


Vadim


> 
>   Revision  Changes    Path
>   1.8       +10 -3     xml-
> cocoon2/src/java/org/apache/cocoon/sitemap/ContentAggregator.java
> 
>   Index: ContentAggregator.java
>   ===================================================================
>   RCS file: /home/cvs/xml-
> cocoon2/src/java/org/apache/cocoon/sitemap/ContentAggregator.java,v
>   retrieving revision 1.7
>   retrieving revision 1.8
>   diff -u -r1.7 -r1.8
>   --- ContentAggregator.java	4 Jun 2002 07:31:52 -0000	1.7
>   +++ ContentAggregator.java	23 Jul 2002 02:04:30 -0000	1.8
>   @@ -289,8 +289,15 @@
>        public void recycle() {
>            super.recycle();
>            this.rootElement = null;
>   -        for (Iterator i = this.parts.iterator(); i.hasNext();)
>   -            this.resolver.release(((Part)i.next()).source);
>   +        for(int i=0; i<this.parts.size();i++) {
>   +            final Part current = (Part)this.parts.get(i);
>   +            if (current.source != null) {
>   +                if (getLogger().isDebugEnabled()) {
>   +                    getLogger().debug("releasing " +
> String.valueOf(current.source));
>   +                }
>   +                this.resolver.release(current.source);
>   +            }
>   +        }
>            this.parts.clear();
>            this.currentElement = null;
>            this.resolver = null;


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


Mime
View raw message