ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/Random.java
(Generate patch)

Comparing jsr166/src/main/java/util/Random.java (file contents):
Revision 1.4 by jsr166, Fri Nov 7 01:36:42 2003 UTC vs.
Revision 1.7 by jsr166, Sun Apr 11 04:50:24 2004 UTC

# Line 1 | Line 1
1   /*
2   * %W% %E%
3   *
4 < * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
4 > * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5   * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6   */
7  
# Line 134 | Line 134 | class Random implements java.io.Serializ
134       */
135      protected int next(int bits) {
136          long oldseed, nextseed;
137 +        AtomicLong seed = this.seed;
138          do {
139 <          oldseed = seed.get();
140 <          nextseed = (oldseed * multiplier + addend) & mask;
139 >            oldseed = seed.get();
140 >            nextseed = (oldseed * multiplier + addend) & mask;
141          } while (!seed.compareAndSet(oldseed, nextseed));
142          return (int)(nextseed >>> (48 - bits));
143      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines