Fixing race-condition in ActorRegistry.actorFor(address)

This commit is contained in:
Viktor Klang 2011-08-30 16:31:07 +02:00
parent e2856c0460
commit 7bc5b2c39c

View file

@ -35,10 +35,7 @@ private[actor] final class ActorRegistry private[actor] () extends ListenerManag
/**
* Finds the actor that has a specific address.
*/
def actorFor(address: String): Option[ActorRef] = {
if (actorsByAddress.containsKey(address)) Some(actorsByAddress.get(address))
else None
}
def actorFor(address: String): Option[ActorRef] = Option(actorsByAddress.get(address))
/**
* Finds the typed actors that have a specific address.