[cvs] / jsr166 / src / test / tck / AtomicIntegerFieldUpdaterTest.java Repository:
ViewVC logotype

Diff of /jsr166/src/test/tck/AtomicIntegerFieldUpdaterTest.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8, Tue Jan 20 20:20:56 2004 UTC revision 1.9, Wed May 25 14:27:37 2005 UTC
# Line 78  Line 78 
78          assertEquals(-3,a.get(this));          assertEquals(-3,a.get(this));
79    
80      }      }
81    
82        /**
83         *  get returns the last value lazySet by same thread
84         */
85        public void testGetLazySet() {
86            AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest> a;
87            try {
88                a = AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdaterTest.class, "x");
89            } catch (RuntimeException ok) {
90                return;
91            }
92            x = 1;
93            assertEquals(1,a.get(this));
94            a.lazySet(this,2);
95            assertEquals(2,a.get(this));
96            a.lazySet(this,-3);
97            assertEquals(-3,a.get(this));
98    
99        }
100    
101      /**      /**
102       * compareAndSet succeeds in changing value if equal to expected else fails       * compareAndSet succeeds in changing value if equal to expected else fails
103       */       */

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8