File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
keywords-Fork/src/main/scala/com/thoughtworks/dsl/keywords Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -113,15 +113,19 @@ object Fork {
113
113
val element = ! ForEach (fork.elements)
114
114
counter.incrementAndGet()
115
115
try {
116
- builder ++= ! Shift (mapper(element));
117
- ()
116
+ val result = ! Shift (mapper(element))
117
+ builder.synchronized [Unit ] {
118
+ builder ++= result
119
+ }
118
120
} catch {
119
121
case MultipleException (throwableSet) =>
120
- exceptionBuilder ++= throwableSet;
121
- ()
122
+ exceptionBuilder.synchronized [Unit ] {
123
+ exceptionBuilder ++= throwableSet
124
+ }
122
125
case e : Throwable =>
123
- exceptionBuilder += e;
124
- ()
126
+ exceptionBuilder.synchronized [Unit ] {
127
+ exceptionBuilder += e
128
+ }
125
129
} finally {
126
130
if (counter.decrementAndGet() > 0 ) {
127
131
! Continue
You can’t perform that action at this time.
0 commit comments