Merge from subtype.
[cacao.git] / src / classes / gnuclasspath / java / lang / VMThread.java
index a511f3cf05691c657a5f6c92d620df11df3e3bae..e4f2595d323353b90ff6f0220b2f7fe50b896c18 100644 (file)
@@ -376,41 +376,42 @@ final class VMThread
      * @throws InterruptedException if the Thread is (or was) interrupted;
      *         it's <i>interrupted status</i> will be cleared
      */
-    static void sleep(long ms, int ns) throws InterruptedException
-    {
-      // Note: JDK treats a zero length sleep is like Thread.yield(),
-      // without checking the interrupted status of the thread.
-      // It's unclear if this is a bug in the implementation or the spec.
-      // See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6213203
-      if (ms == 0 && ns == 0)
-       {
-         if (Thread.interrupted())
-           throw new InterruptedException();
-         return;
-       }
+//     static void sleep(long ms, int ns) throws InterruptedException
+//     {
+//       // Note: JDK treats a zero length sleep is like Thread.yield(),
+//       // without checking the interrupted status of the thread.
+//       // It's unclear if this is a bug in the implementation or the spec.
+//       // See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6213203
+//       if (ms == 0 && ns == 0)
+//     {
+//       if (Thread.interrupted())
+//         throw new InterruptedException();
+//       return;
+//     }
 
-      // Compute end time, but don't overflow
-      long now = System.currentTimeMillis();
-      long end = now + ms;
-      if (end < now)
-         end = Long.MAX_VALUE;
+//       // Compute end time, but don't overflow
+//       long now = System.currentTimeMillis();
+//       long end = now + ms;
+//       if (end < now)
+//       end = Long.MAX_VALUE;
 
-      // A VM is allowed to return from wait() without notify() having been
-      // called, so we loop to handle possible spurious wakeups.
-      VMThread vt = Thread.currentThread().vmThread;
-      synchronized (vt)
-       {
-         while (true)
-           {
-             vt.wait(ms, ns);
-             now = System.currentTimeMillis();
-             if (now >= end)
-               break;
-             ms = end - now;
-             ns = 0;
-           }
-       }
-    }
+//       // A VM is allowed to return from wait() without notify() having been
+//       // called, so we loop to handle possible spurious wakeups.
+//       VMThread vt = Thread.currentThread().vmThread;
+//       synchronized (vt)
+//     {
+//       while (true)
+//         {
+//           vt.wait(ms, ns);
+//           now = System.currentTimeMillis();
+//           if (now >= end)
+//             break;
+//           ms = end - now;
+//           ns = 0;
+//         }
+//     }
+//     }
+    static native void sleep(long ms, int ns) throws InterruptedException;
 
     /**
      * Determine whether the current Thread has been interrupted, and clear