Skip to content

Commit

Permalink
Switch global scope to parent scope in ZIOConcurrent
Browse files Browse the repository at this point in the history
  • Loading branch information
vkorchik committed Feb 17, 2024
1 parent b49e9d2 commit a169b1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ lazy val root = project
unusedCompileDependenciesFilter -= moduleFilter("org.scala-js", "scalajs-library")
)

val zioVersion = "2.0.16"
val zioVersion = "2.0.21"
val catsVersion = "2.9.0"
val catsEffectVersion = "3.4.8"
val catsMtlVersion = "1.3.0"
Expand Down
5 changes: 2 additions & 3 deletions zio-interop-cats/shared/src/main/scala/zio/interop/cats.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import zio.{ Fiber, Ref as ZRef }
import zio.*
import zio.Clock.{ currentTime, nanoTime }
import zio.Duration
import zio.internal.FiberScope
import zio.internal.stacktracer.{ InteropTracer, Tracer as CoreTracer }

import java.util.concurrent.atomic.AtomicBoolean
Expand Down Expand Up @@ -421,9 +420,9 @@ private abstract class ZioConcurrent[R, E, E1]
val raceIndicator = new AtomicBoolean(true)

val leftFiber =
ZIO.unsafe.makeChildFiber(trace, left, parentFiber, parentRuntimeFlags, FiberScope.global)(Unsafe.unsafe)
ZIO.unsafe.makeChildFiber(trace, left, parentFiber, parentRuntimeFlags, parentFiber.scope)(Unsafe.unsafe)
val rightFiber =
ZIO.unsafe.makeChildFiber(trace, right, parentFiber, parentRuntimeFlags, FiberScope.global)(Unsafe.unsafe)
ZIO.unsafe.makeChildFiber(trace, right, parentFiber, parentRuntimeFlags, parentFiber.scope)(Unsafe.unsafe)

val startLeftFiber = leftFiber.startSuspended()(Unsafe.unsafe)
val startRightFiber = rightFiber.startSuspended()(Unsafe.unsafe)
Expand Down

0 comments on commit a169b1f

Please sign in to comment.