Skip to content

Commit 673c211

Browse files
authored
Move uninterruptibleMask outside of ZIO.acquireReleaseExit in toScopedZIO (#707)
The `restore` before this change must've been a no-op, since it was created inside an uninterruptible section
1 parent 47af4c4 commit 673c211

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

zio-interop-cats/shared/src/main/scala/zio/interop/catszmanaged.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,11 @@ final class ZIOResourceSyntax[R, E <: Throwable, A](private val resource: Resour
7171
def go[B](resource: Resource[F, B]): ZIO[R with Scope, E, B] =
7272
resource match {
7373
case allocate: Resource.Allocate[F, b] =>
74-
ZIO.acquireReleaseExit {
75-
ZIO.uninterruptibleMask { restore =>
74+
ZIO.uninterruptibleMask { restore =>
75+
ZIO.acquireReleaseExit {
7676
allocate.resource(toPoll(restore))
77-
}
78-
} { case ((_, release), exit) => toExitCaseThisFiber(exit).flatMap(t => release(t)).orDie }.map(_._1)
77+
} { case ((_, release), exit) => toExitCaseThisFiber(exit).flatMap(t => release(t)).orDie }.map(_._1)
78+
}
7979

8080
case bind: Resource.Bind[F, a, B] =>
8181
go(bind.source).flatMap(a => go(bind.fs(a)))

0 commit comments

Comments
 (0)