ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/AtomicIntegerFieldUpdaterTest.java
(Generate patch)

Comparing jsr166/src/test/tck/AtomicIntegerFieldUpdaterTest.java (file contents):
Revision 1.12 by jsr166, Mon Nov 16 05:30:07 2009 UTC vs.
Revision 1.13 by jsr166, Tue Nov 17 03:12:51 2009 UTC

# Line 123 | Line 123 | public class AtomicIntegerFieldUpdaterTe
123       * compareAndSet in one thread enables another waiting for value
124       * to succeed
125       */
126 <    public void testCompareAndSetInMultipleThreads() {
126 >    public void testCompareAndSetInMultipleThreads() throws Exception {
127          x = 1;
128          final AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest>a;
129          try {
# Line 136 | Line 136 | public class AtomicIntegerFieldUpdaterTe
136                  public void run() {
137                      while (!a.compareAndSet(AtomicIntegerFieldUpdaterTest.this, 2, 3)) Thread.yield();
138                  }});
139 <        try {
140 <            t.start();
141 <            assertTrue(a.compareAndSet(this, 1, 2));
142 <            t.join(LONG_DELAY_MS);
143 <            assertFalse(t.isAlive());
144 <            assertEquals(a.get(this), 3);
145 <        }
146 <        catch (Exception e) {
147 <            unexpectedException();
148 <        }
139 >
140 >        t.start();
141 >        assertTrue(a.compareAndSet(this, 1, 2));
142 >        t.join(LONG_DELAY_MS);
143 >        assertFalse(t.isAlive());
144 >        assertEquals(a.get(this), 3);
145      }
146  
147      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines