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

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

# Line 80 | Line 80 | public class AtomicLongTest extends JSR1
80       */
81      public void testCompareAndSetInMultipleThreads() throws Exception {
82          final AtomicLong ai = new AtomicLong(1);
83 <        Thread t = new Thread(new Runnable() {
84 <                public void run() {
85 <                    while (!ai.compareAndSet(2, 3)) Thread.yield();
86 <                }});
83 >        Thread t = new Thread(new CheckedRunnable() {
84 >            public void realRun() {
85 >                while (!ai.compareAndSet(2, 3))
86 >                    Thread.yield();
87 >            }});
88  
89          t.start();
90          assertTrue(ai.compareAndSet(1, 2));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines