DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37187>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37187





------- Additional Comments From [EMAIL PROTECTED]  2005-10-20 21:26 -------
I've implemented a way to fix it, but I doubt it's ideal. Ideally, the
continuations would be tied to an invocation of the pipeline, not the current
thread.

My fix stores a map of key=current thread, value=stack of Continuation. When a
new continuation is created, it is pushed onto the stack. When it ends, it is
popped. Since the sitemap processing is hiherarchical, this should work. This
does assume that registerThread() and deregisterThread() always called 
correctly.

[from 2.1.7]
diff Continuation.java Continuation_old.java

19d18
< import java.util.Stack;
110,116c109
<               Thread t = Thread.currentThread();
<               Stack threadStack = (Stack)continuationsmap.get(t);
<               if (threadStack == null) {
<                               threadStack = new Stack();
<                               continuationsmap.put(t, threadStack);
<               }
<               threadStack.push(this);
---
>             continuationsmap.put(Thread.currentThread(), this);
125,131c118
<               Thread t = Thread.currentThread();
<               Stack threadStack = (Stack)continuationsmap.get(t);
<               if (threadStack == null)
<                       return;
<               threadStack.pop();
<               if (threadStack.isEmpty())
<               continuationsmap.remove(t);
---
>             continuationsmap.remove(Thread.currentThread());
142,145c129
<                       Stack threadStack = (Stack)continuationsmap.get(t);
<                       if (threadStack == null || threadStack.isEmpty())
<                               return null;
<             return (Continuation) threadStack.peek();
---
>             return (Continuation) continuationsmap.get(t);


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to