#1894 - Switching to jsr166y.ThreadLocalRandom
This commit is contained in:
parent
c752f86ae3
commit
a63e9f604b
1 changed files with 1 additions and 5 deletions
|
|
@ -747,10 +747,6 @@ trait SmallestMailboxLike { this: RouterConfig ⇒
|
|||
|
||||
def routees: Iterable[String]
|
||||
|
||||
private val random = new ThreadLocal[SecureRandom] {
|
||||
override def initialValue = SecureRandom.getInstance("SHA1PRNG")
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the actor is currently processing a message.
|
||||
* It will always return false for remote actors.
|
||||
|
|
@ -819,7 +815,7 @@ trait SmallestMailboxLike { this: RouterConfig ⇒
|
|||
deep: Boolean = false): ActorRef =
|
||||
if (at >= targets.size) {
|
||||
if (deep) {
|
||||
if (proposedTarget.isTerminated) targets(random.get.nextInt(targets.size)) else proposedTarget
|
||||
if (proposedTarget.isTerminated) targets(ThreadLocalRandom.current.nextInt(targets.size)) else proposedTarget
|
||||
} else getNext(targets, proposedTarget, currentScore, 0, deep = true)
|
||||
} else {
|
||||
val target = targets(at)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue