diff --git a/interop-cats/shared/src/main/scala/zio/interop/cats.scala b/interop-cats/shared/src/main/scala/zio/interop/cats.scala index f3a89b39..898828a3 100644 --- a/interop-cats/shared/src/main/scala/zio/interop/cats.scala +++ b/interop-cats/shared/src/main/scala/zio/interop/cats.scala @@ -227,13 +227,6 @@ private class CatsConcurrent[R] extends CatsMonadError[R, Throwable] with Concur Left(token.orDie) } - override final def race[A, B](fa: RIO[R, A], fb: RIO[R, B]): RIO[R, Either[A, B]] = { - def run[C](fc: RIO[R, C]): ZIO[R, Throwable, C] = - fc.interruptible.overrideForkScope(ZScope.global) - - run(fa.map(Left(_))) raceFirst run(fb.map(Right(_))) - } - override final def start[A](fa: RIO[R, A]): RIO[R, effect.Fiber[RIO[R, *], A]] = fa.interruptible.forkDaemon.map(toFiber) @@ -247,7 +240,7 @@ private class CatsConcurrent[R] extends CatsMonadError[R, Throwable] with Concur (run(fa) raceWith run(fb))( { case (l, f) => l.fold(f.interrupt *> ZIO.halt(_), ZIO.succeedNow).map(lv => Left((lv, toFiber(f)))) }, { case (r, f) => r.fold(f.interrupt *> ZIO.halt(_), ZIO.succeedNow).map(rv => Right((toFiber(f), rv))) } - ) + ).resetForkScope } override final def never[A]: RIO[R, A] =