Move sync. No performance change but sync requirements for sub-classes are clearer.
Still looking to remove sync completely.
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@
1035720 13f79535-47bb-0310-9956-
ffa450edef68
}
- protected void getRandomBytes(byte bytes[]) {
+ protected synchronized void getRandomBytes(byte bytes[]) {
// Generate a byte array containing a session identifier
if (devRandomSourceIsValid && randomIS == null) {
setRandomFile(devRandomSource);
}
while (resultLenBytes < this.sessionIdLength) {
- synchronized (this) {
- getRandomBytes(random);
- }
+ getRandomBytes(random);
MessageDigest md = digests.poll();
if (md == null) {
// If this fails, NPEs will follow. This should never fail