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

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.87 by jsr166, Mon May 30 22:53:21 2011 UTC vs.
Revision 1.88 by jsr166, Tue May 31 15:01:24 2011 UTC

# Line 690 | Line 690 | public class JSR166TestCase extends Test
690      }
691  
692      /**
693 <     * Waits up to the specified number of milliseconds for the given
693 >     * Spin-waits up to the specified number of milliseconds for the given
694       * thread to enter a wait state: BLOCKED, WAITING, or TIMED_WAITING.
695       */
696      void waitForThreadToEnterWaitState(Thread thread, long timeoutMillis) {
697 <        long timeoutNanos = timeoutMillis * 1000L * 1000L;
698 <        long t0 = System.nanoTime();
697 >        long startTime = System.nanoTime();
698          for (;;) {
699              Thread.State s = thread.getState();
700              if (s == Thread.State.BLOCKED ||
# Line 704 | Line 703 | public class JSR166TestCase extends Test
703                  return;
704              else if (s == Thread.State.TERMINATED)
705                  fail("Unexpected thread termination");
706 <            else if (System.nanoTime() - t0 > timeoutNanos) {
706 >            else if (millisElapsedSince(startTime) > timeoutMillis) {
707                  threadAssertTrue(thread.isAlive());
708                  return;
709              }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines