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

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

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines