You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pekko.apache.org by he...@apache.org on 2025/09/06 15:00:48 UTC
(pekko) 01/01: chore: deprecate ReentrantGuard
This is an automated email from the ASF dual-hosted git repository.
hepin pushed a commit to branch guard-1.2
in repository https://gitbox.apache.org/repos/asf/pekko.git
commit 4d444dae34f488f3129ae9bb95ae275db97f6cab
Author: He-Pin <he...@gmail.com>
AuthorDate: Sat Sep 6 23:00:28 2025 +0800
chore: deprecate ReentrantGuard
---
.../main/scala/org/apache/pekko/dispatch/affinity/AffinityPool.scala | 3 ++-
actor/src/main/scala/org/apache/pekko/event/Logging.scala | 5 ++---
actor/src/main/scala/org/apache/pekko/util/LockUtil.scala | 1 +
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/actor/src/main/scala/org/apache/pekko/dispatch/affinity/AffinityPool.scala b/actor/src/main/scala/org/apache/pekko/dispatch/affinity/AffinityPool.scala
index a1be4c479f..ca45f21623 100644
--- a/actor/src/main/scala/org/apache/pekko/dispatch/affinity/AffinityPool.scala
+++ b/actor/src/main/scala/org/apache/pekko/dispatch/affinity/AffinityPool.scala
@@ -20,7 +20,7 @@ import java.util.concurrent.TimeUnit.MICROSECONDS
import java.util.concurrent.atomic.AtomicReference
import java.util.concurrent.locks.LockSupport
-import scala.annotation.{ switch, tailrec }
+import scala.annotation.{ nowarn, switch, tailrec }
import scala.collection.{ immutable, mutable }
import com.typesafe.config.Config
@@ -140,6 +140,7 @@ private[pekko] class AffinityPool(
// adding a worker. We want the creation of the worker, addition
// to the set and starting to worker to be an atomic action. Using
// a concurrent set would not give us that
+ @nowarn("msg=deprecated")
private val bookKeepingLock = new ReentrantGuard()
// condition used for awaiting termination
diff --git a/actor/src/main/scala/org/apache/pekko/event/Logging.scala b/actor/src/main/scala/org/apache/pekko/event/Logging.scala
index c554a47929..e8efd0271d 100644
--- a/actor/src/main/scala/org/apache/pekko/event/Logging.scala
+++ b/actor/src/main/scala/org/apache/pekko/event/Logging.scala
@@ -16,14 +16,12 @@ package org.apache.pekko.event
import java.util.concurrent.TimeoutException
import java.util.concurrent.atomic.AtomicInteger
-import scala.annotation.implicitNotFound
+import scala.annotation.{ implicitNotFound, nowarn }
import scala.collection.immutable
import scala.concurrent.Await
import scala.language.existentials
import scala.util.control.{ NoStackTrace, NonFatal }
-import scala.annotation.nowarn
-
import org.apache.pekko
import pekko.{ ConfigurationException, PekkoException }
import pekko.actor._
@@ -50,6 +48,7 @@ trait LoggingBus extends ActorEventBus {
import Logging._
+ @nowarn("msg=deprecated")
private val guard = new ReentrantGuard
private var loggers = Seq.empty[ActorRef]
@volatile private var _logLevel: LogLevel = _
diff --git a/actor/src/main/scala/org/apache/pekko/util/LockUtil.scala b/actor/src/main/scala/org/apache/pekko/util/LockUtil.scala
index 5c8c834a9a..5d87c29bb9 100644
--- a/actor/src/main/scala/org/apache/pekko/util/LockUtil.scala
+++ b/actor/src/main/scala/org/apache/pekko/util/LockUtil.scala
@@ -16,6 +16,7 @@ package org.apache.pekko.util
import java.util.concurrent.atomic.AtomicBoolean
import java.util.concurrent.locks.ReentrantLock
+@deprecated("Use java.util.concurrent.locks.ReentrantLock directly, will be removed in Pekko 2.0.0", "1.2.0")
final class ReentrantGuard extends ReentrantLock {
final def withGuard[T](body: => T): T = {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pekko.apache.org
For additional commands, e-mail: commits-help@pekko.apache.org