compiler/6434117/TestNativeRevocation.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File closed Sdiff compiler/6434117

compiler/6434117/TestNativeRevocation.java

Print this page


   1 /*
   2  * @test
   3  * @bug 6434117
   4  * @summary debug info for native methods illegally references register
   5  * @run main/othervm -server -XX:+UseBiasedLocking TestNativeRevocation
   6 */
   7 
   8 import java.util.*;
   9 
  10 public class TestNativeRevocation {
  11   private static String tmp;
  12 
  13   static class RevokerThread extends Thread {
  14     private List queue = new ArrayList();
  15 
  16     volatile boolean cont = true;
  17     public void run() {
  18       while (cont) {
  19         synchronized (queue) {
  20           if (queue.size() > 0) {
  21             Throwable t = (Throwable) queue.remove(0);



  22             synchronized (t) {
  23               tmp = t.getMessage();
  24             }
  25           }
  26           while (queue.size() == 0) {
  27             try {
  28               queue.wait();
  29             } catch (InterruptedException e) {
  30               cont = false;
  31             }
  32           }
  33         }
  34       }
  35     }
  36 
  37     public void give(Throwable t) {
  38       synchronized (queue) {
  39         queue.add(t);
  40         queue.notifyAll();
  41       }
  42     }
  43   }
  44 
  45   public static void main(String[] args) {
  46     RevokerThread revoker = new RevokerThread();
   1 /*
   2  * @test
   3  * @bug 6434117
   4  * @summary debug info for native methods illegally references register
   5  * @run main/othervm -server -XX:+UseBiasedLocking -XX:BiasedLockingStartupDelay=50 TestNativeRevocation
   6 */
   7 
   8 import java.util.*;
   9 
  10 public class TestNativeRevocation {
  11   private static String tmp;
  12 
  13   static class RevokerThread extends Thread {
  14     private List queue = new ArrayList();
  15 
  16     volatile boolean cont = true;
  17     public void run() {
  18       while (cont) {
  19         synchronized (queue) {
  20           if (queue.size() > 0) {
  21             // Remove element from the end of the list to keep
  22             // the list small (avoid elements shift to keep up
  23             // with queue.add(t)).
  24             Throwable t = (Throwable) queue.remove(queue.size()-1);
  25             synchronized (t) {
  26               tmp = t.getMessage();
  27             }
  28           }
  29           while (cont && queue.size() == 0) {
  30             try {
  31               queue.wait();
  32             } catch (InterruptedException e) {
  33               cont = false;
  34             }
  35           }
  36         }
  37       }
  38     }
  39 
  40     public void give(Throwable t) {
  41       synchronized (queue) {
  42         queue.add(t);
  43         queue.notifyAll();
  44       }
  45     }
  46   }
  47 
  48   public static void main(String[] args) {
  49     RevokerThread revoker = new RevokerThread();
compiler/6434117/TestNativeRevocation.java
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File