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

Comparing jsr166/src/test/tck/AtomicIntegerArrayTest.java (file contents):
Revision 1.14 by jsr166, Tue Nov 17 02:37:16 2009 UTC vs.
Revision 1.15 by jsr166, Tue Nov 17 06:58:50 2009 UTC

# Line 133 | Line 133 | public class AtomicIntegerArrayTest exte
133      public void testCompareAndSetInMultipleThreads() throws Exception {
134          final AtomicIntegerArray a = new AtomicIntegerArray(1);
135          a.set(0, 1);
136 <        Thread t = new Thread(new Runnable() {
137 <                public void run() {
138 <                    while (!a.compareAndSet(0, 2, 3)) Thread.yield();
139 <                }});
136 >        Thread t = new Thread(new CheckedRunnable() {
137 >            public void realRun() {
138 >                while (!a.compareAndSet(0, 2, 3))
139 >                    Thread.yield();
140 >            }});
141  
142          t.start();
143          assertTrue(a.compareAndSet(0, 1, 2));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines