> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>
> 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: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]