diff --git a/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala b/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala index a2f4b844dd..ffdf1987fd 100644 --- a/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala +++ b/akka-actor/src/main/scala/akka/dispatch/AbstractDispatcher.scala @@ -392,7 +392,7 @@ abstract class MessageDispatcher(val prerequisites: DispatcherPrerequisites) ext def suspend(actor: ActorCell): Unit = { val mbox = actor.mailbox if ((mbox.actor eq actor) && (mbox.dispatcher eq this)) - mbox.becomeSuspended() + mbox.suspend() } /* @@ -400,7 +400,7 @@ abstract class MessageDispatcher(val prerequisites: DispatcherPrerequisites) ext */ def resume(actor: ActorCell): Unit = { val mbox = actor.mailbox - if ((mbox.actor eq actor) && (mbox.dispatcher eq this) && mbox.becomeOpen()) + if ((mbox.actor eq actor) && (mbox.dispatcher eq this) && mbox.resume()) registerForExecution(mbox, false, false) } diff --git a/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala b/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala index 2ae4616c95..a419cfd7f9 100644 --- a/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala +++ b/akka-actor/src/main/scala/akka/dispatch/Mailbox.scala @@ -124,32 +124,32 @@ private[akka] abstract class Mailbox(val messageQueue: MessageQueue) Unsafe.instance.putIntVolatile(this, AbstractMailbox.mailboxStatusOffset, newStatus) /** - * set new primary status Open. Caller does not need to worry about whether + * Reduce the suspend count by one. Caller does not need to worry about whether * status was Scheduled or not. * * @returns true if the suspend count reached zero */ @tailrec - final def becomeOpen(): Boolean = status match { + final def resume(): Boolean = status match { case Closed ⇒ setStatus(Closed); false case s ⇒ val next = if (s < suspendUnit) s else s - suspendUnit if (updateStatus(s, next)) next < suspendUnit - else becomeOpen() + else resume() } /** - * set new primary status Suspended. Caller does not need to worry about whether + * Increment the suspend count by one. Caller does not need to worry about whether * status was Scheduled or not. * * @returns true if the previous suspend count was zero */ @tailrec - final def becomeSuspended(): Boolean = status match { + final def suspend(): Boolean = status match { case Closed ⇒ setStatus(Closed); false case s ⇒ if (updateStatus(s, s + suspendUnit)) s < suspendUnit - else becomeSuspended() + else suspend() } /** diff --git a/akka-testkit/src/main/scala/akka/testkit/CallingThreadDispatcher.scala b/akka-testkit/src/main/scala/akka/testkit/CallingThreadDispatcher.scala index fded5e5640..07830a43b6 100644 --- a/akka-testkit/src/main/scala/akka/testkit/CallingThreadDispatcher.scala +++ b/akka-testkit/src/main/scala/akka/testkit/CallingThreadDispatcher.scala @@ -151,7 +151,7 @@ class CallingThreadDispatcher( override def suspend(actor: ActorCell) { actor.mailbox match { - case m: CallingThreadMailbox ⇒ m.suspendSwitch.switchOn; m.becomeSuspended() + case m: CallingThreadMailbox ⇒ m.suspendSwitch.switchOn; m.suspend() case m ⇒ m.systemEnqueue(actor.self, Suspend()) } } @@ -163,7 +163,7 @@ class CallingThreadDispatcher( val wasActive = queue.isActive val switched = mbox.suspendSwitch.switchOff { CallingThreadDispatcherQueues(actor.system).gatherFromAllOtherQueues(mbox, queue) - mbox.becomeOpen() + mbox.resume() } if (switched && !wasActive) { runQueue(mbox, queue)