#3018 - Enabling -Xlint and dealing with the situation that occurs

This commit is contained in:
Viktor Klang 2013-03-28 23:45:48 +01:00
parent 88f7e28c6b
commit c883705242
75 changed files with 249 additions and 275 deletions

View file

@ -48,7 +48,7 @@ private[testkit] class CallingThreadDispatcherQueues extends Extension {
private var lastGC = 0l
// we have to forget about long-gone threads sometime
private def gc {
private def gc(): Unit = {
queues = (Map.newBuilder[CallingThreadMailbox, Set[WeakReference[MessageQueue]]] /: queues) {
case (m, (k, v))
val nv = v filter (_.get ne null)
@ -66,7 +66,7 @@ private[testkit] class CallingThreadDispatcherQueues extends Extension {
val now = System.nanoTime
if (now - lastGC > 1000000000l) {
lastGC = now
gc
gc()
}
}
@ -165,16 +165,14 @@ class CallingThreadDispatcher(
mbox foreach CallingThreadDispatcherQueues(actor.system).unregisterQueues
}
override def suspend(actor: ActorCell) {
protected[akka] override def suspend(actor: ActorCell) {
actor.mailbox match {
case m: CallingThreadMailbox
m.suspendSwitch.switchOn; m.suspend()
case m
m.systemEnqueue(actor.self, Suspend())
case m: CallingThreadMailbox { m.suspendSwitch.switchOn; m.suspend() }
case m m.systemEnqueue(actor.self, Suspend())
}
}
override def resume(actor: ActorCell) {
protected[akka] override def resume(actor: ActorCell) {
actor.mailbox match {
case mbox: CallingThreadMailbox
val queue = mbox.queue