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

Comparing jsr166/src/test/tck-jsr166e/AtomicDoubleTest.java (file contents):
Revision 1.5 by jsr166, Wed Aug 10 07:27:11 2011 UTC vs.
Revision 1.6 by jsr166, Wed Aug 10 07:30:25 2011 UTC

# Line 112 | Line 112 | public class AtomicDoubleTest extends JS
112       */
113      public void testCompareAndSetInMultipleThreads() throws Exception {
114          final AtomicDouble at = new AtomicDouble(1.0);
115 <        Thread t = new Thread(new CheckedRunnable() {
115 >        Thread t = newStartedThread(new CheckedRunnable() {
116              public void realRun() {
117                  while (!at.compareAndSet(2.0, 3.0))
118                      Thread.yield();
119              }});
120  
121        t.start();
121          assertTrue(at.compareAndSet(1.0, 2.0));
122 <        t.join(LONG_DELAY_MS);
124 <        assertFalse(t.isAlive());
122 >        awaitTermination(t);
123          assertBitEquals(3.0, at.get());
124      }
125  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines