Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

To fix? #8771

Closed
wants to merge 1 commit into from
Closed

To fix? #8771

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 10 additions & 1 deletion core/shared/src/main/scala/zio/internal/FiberRuntime.scala
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ final class FiberRuntime[E, A](fiberId: FiberId.Runtime, fiberRefs0: FiberRefs,

def inheritAll(implicit trace: Trace): UIO[Unit] =
ZIO.withFiberRuntime[Any, Nothing, Unit] { (parentFiber, parentStatus) =>
implicit val unsafe = Unsafe.unsafe
implicit val unsafe: Unsafe = Unsafe.unsafe

val parentFiberId = parentFiber.id
val parentFiberRefs = parentFiber.getFiberRefs()
Expand Down Expand Up @@ -787,6 +787,15 @@ final class FiberRuntime[E, A](fiberId: FiberId.Runtime, fiberRefs0: FiberRefs,

val k = self._asyncContWith

// TODO: To fix?
// 1. `k` is `_asyncContWith` which is a `ZIO[Any, Any, Any] => Any`
// 2. `notBlockingOn` is a `() => FiberId`
// 3. `notBlockingOn` seems to never be assigned to `_asyncContWith` (needs a deeper look to be sure about this)
// 4. which would mean that `k ne FiberRuntime.notBlockingOn` would always be `true`
// 5. which would mean that this `(k ne FiberRuntime.notBlockingOn)` test is useless
// Some questions to answer then:
// 1. Why and when was it added?
// 2. If it's indeed incorrect/useless, should it be removed or replaced with something else? What was the intention of the original author?
if ((k ne null) && (k ne FiberRuntime.notBlockingOn)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's useless and can be removed. Maybe it was part of my work in (high-perfomrantly) integrating blocking into ZIO's Loom support.

k(Exit.Failure(cause))
}
Expand Down