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

Comparing jsr166/src/test/tck/AtomicReferenceTest.java (file contents):
Revision 1.12 by jsr166, Tue Nov 17 03:12:51 2009 UTC vs.
Revision 1.13 by jsr166, Tue Nov 17 06:58:50 2009 UTC

# Line 78 | Line 78 | public class AtomicReferenceTest extends
78       */
79      public void testCompareAndSetInMultipleThreads() throws Exception {
80          final AtomicReference ai = new AtomicReference(one);
81 <        Thread t = new Thread(new Runnable() {
82 <                public void run() {
83 <                    while (!ai.compareAndSet(two, three)) Thread.yield();
84 <                }});
81 >        Thread t = new Thread(new CheckedRunnable() {
82 >            public void realRun() {
83 >                while (!ai.compareAndSet(two, three))
84 >                    Thread.yield();
85 >            }});
86  
87          t.start();
88          assertTrue(ai.compareAndSet(one, two));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines