Skip to content

Commit

Permalink
Merge pull request typelevel#4117 from armanbilge/topic/register-is-a…
Browse files Browse the repository at this point in the history
…ccess

`register` -> `accessPoller`
  • Loading branch information
djspiewak authored Aug 20, 2024
2 parents caee0e8 + f51f240 commit 7168625
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private[unsafe] abstract class IORuntimeCompanionPlatform { this: IORuntime.type

(
threadPool,
pollingSystem.makeApi(threadPool.register),
pollingSystem.makeApi(threadPool.accessPoller),
{ () =>
unregisterMBeans()
threadPool.shutdown()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private[effect] final class WorkStealingThreadPool[P](
private[unsafe] val pollers: Array[P] =
new Array[AnyRef](threadCount).asInstanceOf[Array[P]]

private[unsafe] def register(cb: P => Unit): Unit = {
private[unsafe] def accessPoller(cb: P => Unit): Unit = {

// figure out where we are
val thread = Thread.currentThread()
Expand All @@ -97,8 +97,8 @@ private[effect] final class WorkStealingThreadPool[P](
if (worker.isOwnedBy(pool)) // we're good
cb(worker.poller())
else // possibly a blocking worker thread, possibly on another wstp
scheduleExternal(() => register(cb))
} else scheduleExternal(() => register(cb))
scheduleExternal(() => accessPoller(cb))
} else scheduleExternal(() => accessPoller(cb))
}

/**
Expand Down

0 comments on commit 7168625

Please sign in to comment.