Back off if another thread has processed all messages for this actor. See #3064
This commit is contained in:
parent
52e1bb3d92
commit
ccdee92961
2 changed files with 106 additions and 102 deletions
|
|
@ -388,12 +388,15 @@ private[akka] trait DefaultSystemMessageQueue { self: Mailbox ⇒
|
|||
}
|
||||
|
||||
@tailrec
|
||||
final def systemDrain(newContents: SystemMessage): SystemMessage = {
|
||||
val head = systemQueueGet
|
||||
if (systemQueuePut(head, newContents)) SystemMessage.reverse(head) else systemDrain(newContents)
|
||||
final def systemDrain(newContents: SystemMessage): SystemMessage = systemQueueGet match {
|
||||
case NoMessage ⇒ null
|
||||
case head ⇒ if (systemQueuePut(head, newContents)) SystemMessage.reverse(head) else systemDrain(newContents)
|
||||
}
|
||||
|
||||
def hasSystemMessages: Boolean = systemQueueGet ne null
|
||||
def hasSystemMessages: Boolean = systemQueueGet match {
|
||||
case null | NoMessage ⇒ false
|
||||
case _ ⇒ true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue