We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2320db2 commit b7a3835Copy full SHA for b7a3835
keywords-Fork/src/main/scala/com/thoughtworks/dsl/keywords/Fork.scala
@@ -113,15 +113,19 @@ object Fork {
113
val element = !ForEach(fork.elements)
114
counter.incrementAndGet()
115
try {
116
- builder ++= !Shift(mapper(element));
117
- ()
+ val result = !Shift(mapper(element))
+ builder.synchronized[Unit] {
118
+ builder ++= result
119
+ }
120
} catch {
121
case MultipleException(throwableSet) =>
- exceptionBuilder ++= throwableSet;
122
+ exceptionBuilder.synchronized[Unit] {
123
+ exceptionBuilder ++= throwableSet
124
125
case e: Throwable =>
- exceptionBuilder += e;
126
127
+ exceptionBuilder += e
128
129
} finally {
130
if (counter.decrementAndGet() > 0) {
131
!Continue
0 commit comments