Merge branch 'master' of github.com:jboner/akka

This commit is contained in:
Roland 2012-02-13 22:32:12 +01:00
commit 2cf9353ca3
2 changed files with 8 additions and 11 deletions

View file

@ -388,8 +388,6 @@ private[akka] class ActorCell(
failedActor.preRestart(cause, if (c ne null) Some(c.message) else None)
} finally {
clearActorFields()
currentMessage = null
actor = null
}
}
actor = freshActor // assign it here so if preStart fails, we can null out the sef-refs next call
@ -559,9 +557,8 @@ private[akka] class ActorCell(
if (system.settings.DebugLifecycle)
system.eventStream.publish(Debug(self.path.toString, clazz(actor), "stopped")) // FIXME: can actor be null?
} finally {
currentMessage = null
clearActorFields()
if (a ne null) a.clearBehaviorStack()
clearActorFields()
}
}
}
@ -601,7 +598,11 @@ private[akka] class ActorCell(
}
}
final def clearActorFields(): Unit = setActorFields(context = null, self = system.deadLetters)
final def clearActorFields(): Unit = {
setActorFields(context = null, self = system.deadLetters)
currentMessage = null
actor = null
}
final def setActorFields(context: ActorContext, self: ActorRef) {
@tailrec
@ -629,8 +630,5 @@ private[akka] class ActorCell(
}
}
private def clazz(o: AnyRef): Class[_] = {
if (o eq null) this.getClass
else o.getClass
}
private final def clazz(o: AnyRef): Class[_] = if (o eq null) this.getClass else o.getClass
}

View file

@ -95,8 +95,7 @@ class BalancingDispatcher(
override protected[akka] def dispatch(receiver: ActorCell, invocation: Envelope) = {
messageQueue.enqueue(receiver.self, invocation)
registerForExecution(receiver.mailbox, false, false)
teamWork()
if (!registerForExecution(receiver.mailbox, false, false)) teamWork()
}
protected def teamWork(): Unit = if (attemptTeamWork) {