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

Comparing jsr166/src/test/tck/AtomicLongFieldUpdaterTest.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 124 | Line 124 | public class AtomicLongFieldUpdaterTest
124       * compareAndSet in one thread enables another waiting for value
125       * to succeed
126       */
127 <    public void testCompareAndSetInMultipleThreads() {
127 >    public void testCompareAndSetInMultipleThreads() throws Exception {
128          x = 1;
129          final AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest>a;
130          try {
# Line 137 | Line 137 | public class AtomicLongFieldUpdaterTest
137                  public void run() {
138                      while (!a.compareAndSet(AtomicLongFieldUpdaterTest.this, 2, 3)) Thread.yield();
139                  }});
140 <        try {
141 <            t.start();
142 <            assertTrue(a.compareAndSet(this, 1, 2));
143 <            t.join(LONG_DELAY_MS);
144 <            assertFalse(t.isAlive());
145 <            assertEquals(a.get(this), 3);
146 <        }
147 <        catch (Exception e) {
148 <            unexpectedException();
149 <        }
140 >
141 >        t.start();
142 >        assertTrue(a.compareAndSet(this, 1, 2));
143 >        t.join(LONG_DELAY_MS);
144 >        assertFalse(t.isAlive());
145 >        assertEquals(a.get(this), 3);
146      }
147  
148      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines