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.15 by jsr166, Thu Feb 16 08:17:21 2006 UTC vs.
Revision 1.18 by jsr166, Sun Jan 7 07:38:27 2007 UTC

# Line 1 | Line 1
1   /*
2   * %W% %E%
3   *
4 < * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
4 > * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
5   * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6   */
7  
# Line 136 | Line 136 | class Random implements java.io.Serializ
136          do {
137              oldseed = seed.get();
138              nextseed = (oldseed * multiplier + addend) & mask;
139 <        } while (!seed.compareAndSet(oldseed, nextseed));
139 >        } while (!seed.weakCompareAndSet(oldseed, nextseed));
140          return (int)(nextseed >>> (48 - bits));
141      }
142  
# Line 523 | Line 523 | class Random implements java.io.Serializ
523          try {
524              seedOffset = unsafe.objectFieldOffset
525                  (Random.class.getDeclaredField("seed"));
526 <            } catch (Exception ex) { throw new Error(ex); }
526 >        } catch (Exception ex) { throw new Error(ex); }
527      }
528      private void resetSeed(long seedVal) {
529          unsafe.putObjectVolatile(this, seedOffset, new AtomicLong(seedVal));
530      }
531
531   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines