Skip to content

Commit f62923c

Browse files
author
zhourenjian@gmail.com
committed
Synchronize on pipe object to initialize pipe data on #pipeCloneData
1 parent 2dac2ea commit f62923c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

sources/net.sf.j2s.ajax/ajaxpipe/net/sf/j2s/ajax/SimplePipeHelper.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,8 @@ public static void pipeIn(String key, SimpleSerializable[] ss) {
222222
}
223223
}
224224
c.setCached(true);
225-
list.add(s);
226-
} else {
227-
list.add(s);
228225
}
226+
list.add(s);
229227
if (!hasNewPriority && s instanceof ISimplePipePriority) {
230228
hasNewPriority = true;
231229
}

sources/net.sf.j2s.ajax/ajaxpipe/net/sf/j2s/ajax/SimplePipeRunnable.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,11 @@ protected void pipeCloneData(SimplePipeRunnable anotherPipe, SimpleFilter filter
246246
if (anotherPipe != null && anotherPipe.pipeData != null && anotherPipe.pipeData.size() > 0) {
247247
if (pipeData == null) {
248248
List<SimpleSerializable> data = new Vector<SimpleSerializable>(anotherPipe.pipeData.size());
249-
pipeData = data;
249+
synchronized (this) {
250+
if (pipeData == null) {
251+
pipeData = data;
252+
}
253+
}
250254
}
251255
synchronized (pipeData) {
252256
synchronized (anotherPipe.pipeData) {

0 commit comments

Comments
 (0)