From 862b60cd1f27369881b2c320a3d06a975c703d75 Mon Sep 17 00:00:00 2001 From: Arman Bilge Date: Mon, 8 Jan 2024 20:59:20 +0000 Subject: [PATCH] Bikeshed --- .../scala/cats/effect/unsafe/WorkStealingThreadPool.scala | 2 +- .../scala/cats/effect/unsafe/WorkStealingThreadPool.scala | 4 ++-- core/jvm/src/main/scala/cats/effect/unsafe/WorkerThread.scala | 4 ++-- core/shared/src/main/scala/cats/effect/IOFiber.scala | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/js-native/src/main/scala/cats/effect/unsafe/WorkStealingThreadPool.scala b/core/js-native/src/main/scala/cats/effect/unsafe/WorkStealingThreadPool.scala index 702fa612a8..1b0ff7b5a2 100644 --- a/core/js-native/src/main/scala/cats/effect/unsafe/WorkStealingThreadPool.scala +++ b/core/js-native/src/main/scala/cats/effect/unsafe/WorkStealingThreadPool.scala @@ -36,7 +36,7 @@ private[effect] sealed abstract class WorkStealingThreadPool private () task: Runnable, fallback: Scheduler): Runnable private[effect] def canExecuteBlockingCode(): Boolean - private[effect] def prepareBlocking(): Unit + private[effect] def prepareForBlocking(): Unit private[unsafe] def liveTraces(): ( Map[Runnable, Trace], Map[WorkerThread, (Thread.State, Option[(Runnable, Trace)], Map[Runnable, Trace])], diff --git a/core/jvm/src/main/scala/cats/effect/unsafe/WorkStealingThreadPool.scala b/core/jvm/src/main/scala/cats/effect/unsafe/WorkStealingThreadPool.scala index 88e0cceff3..ab815b25e3 100644 --- a/core/jvm/src/main/scala/cats/effect/unsafe/WorkStealingThreadPool.scala +++ b/core/jvm/src/main/scala/cats/effect/unsafe/WorkStealingThreadPool.scala @@ -502,10 +502,10 @@ private[effect] final class WorkStealingThreadPool( * Prepares the current thread for running blocking code. This should be called only if * [[canExecuteBlockingCode]] returns `true`. */ - private[effect] def prepareBlocking(): Unit = { + private[effect] def prepareForBlocking(): Unit = { val thread = Thread.currentThread() val worker = thread.asInstanceOf[WorkerThread] - worker.prepareBlocking() + worker.prepareForBlocking() } /** diff --git a/core/jvm/src/main/scala/cats/effect/unsafe/WorkerThread.scala b/core/jvm/src/main/scala/cats/effect/unsafe/WorkerThread.scala index 893df5d223..35d265d251 100644 --- a/core/jvm/src/main/scala/cats/effect/unsafe/WorkerThread.scala +++ b/core/jvm/src/main/scala/cats/effect/unsafe/WorkerThread.scala @@ -797,7 +797,7 @@ private final class WorkerThread( * There is no reason to enclose any code in a `try/catch` block because the only way this * code path can be exercised is through `IO.delay`, which already handles exceptions. */ - def prepareBlocking(): Unit = { + def prepareForBlocking(): Unit = { val rnd = random pool.notifyParked(rnd) @@ -858,7 +858,7 @@ private final class WorkerThread( * A mechanism for executing support code before executing a blocking action. */ override def blockOn[T](thunk: => T)(implicit permission: CanAwait): T = { - prepareBlocking() + prepareForBlocking() thunk } diff --git a/core/shared/src/main/scala/cats/effect/IOFiber.scala b/core/shared/src/main/scala/cats/effect/IOFiber.scala index 402cbd75f2..d0f86707a6 100644 --- a/core/shared/src/main/scala/cats/effect/IOFiber.scala +++ b/core/shared/src/main/scala/cats/effect/IOFiber.scala @@ -991,7 +991,7 @@ private final class IOFiber[A]( if (ec.isInstanceOf[WorkStealingThreadPool]) { val wstp = ec.asInstanceOf[WorkStealingThreadPool] if (wstp.canExecuteBlockingCode()) { - wstp.prepareBlocking() + wstp.prepareForBlocking() var error: Throwable = null val r =