Modifications after review

This commit is contained in:
Viktor Klang 2012-01-21 13:04:45 +01:00
parent 42d3328815
commit 61e0bd568b

View file

@ -174,15 +174,15 @@ private[akka] abstract class Mailbox(val actor: ActorCell) extends MessageQueue
* Process the messages in the mailbox
*/
@tailrec private final def processMailbox(
left: Int = java.lang.Math.min(dispatcher.throughput, 1),
deadlineNs: Long = if (dispatcher.isThroughputDeadlineTimeDefined) System.nanoTime + dispatcher.throughputDeadlineTime.toNanos else 0l): Unit =
left: Int = java.lang.Math.max(dispatcher.throughput, 1),
deadlineNs: Long = if (dispatcher.isThroughputDeadlineTimeDefined) System.nanoTime + dispatcher.throughputDeadlineTime.toNanos else 0L): Unit =
if (shouldProcessMessage) {
val next = dequeue()
if (next ne null) {
if (Mailbox.debug) println(actor.self + " processing message " + next)
actor invoke next
processAllSystemMessages()
if ((left > 1) && (!dispatcher.isThroughputDeadlineTimeDefined || System.nanoTime < deadlineNs))
if ((left > 1) && ((!dispatcher.isThroughputDeadlineTimeDefined) || (System.nanoTime - deadlineNs) < 0))
processMailbox(left - 1, deadlineNs)
}
}