< prev index next >

test/hotspot/jtreg/vmTestbase/gc/gctests/gctest02/gctest02.java

Print this page
rev 56807 : [mq]: 8232684-v2


 163                 while ( doit() ) {
 164                         if ( LocalRandom.random() > 0.6668) {
 165                                 try {
 166                                         sleep(10);   // to be nice
 167                                 }
 168                                 catch (InterruptedException e) {
 169                                 }
 170                         }
 171                         Thread.yield();
 172                 }
 173                 //we've reached the population limit, so we're exiting the thread
 174                 ThreadCount.dec();
 175         }
 176 }
 177 
 178 class Escaper extends Thread {
 179         public void run() {
 180                 while ( ThreadCount.get() > 0 ) {
 181                         int buf[] = new int[32];
 182                         {
 183                                                 yield();
 184                         }
 185                 }
 186         }
 187 }
 188 
 189 public class gctest02 {
 190         public static void main(String args[] ) {
 191                 int bufsz = 8;
 192                 int peopleLimit = 1000;
 193                 long randomSeed = System.currentTimeMillis();
 194                 Memevil me=null;
 195                 if (args.length > 0)
 196                 {
 197                         try
 198                         {
 199                                 peopleLimit = new Integer(args[0]).intValue();
 200                         }
 201                         catch (NumberFormatException e)
 202                         {
 203                                 throw new TestBug(




 163                 while ( doit() ) {
 164                         if ( LocalRandom.random() > 0.6668) {
 165                                 try {
 166                                         sleep(10);   // to be nice
 167                                 }
 168                                 catch (InterruptedException e) {
 169                                 }
 170                         }
 171                         Thread.yield();
 172                 }
 173                 //we've reached the population limit, so we're exiting the thread
 174                 ThreadCount.dec();
 175         }
 176 }
 177 
 178 class Escaper extends Thread {
 179         public void run() {
 180                 while ( ThreadCount.get() > 0 ) {
 181                         int buf[] = new int[32];
 182                         {
 183                                                 Thread.yield();
 184                         }
 185                 }
 186         }
 187 }
 188 
 189 public class gctest02 {
 190         public static void main(String args[] ) {
 191                 int bufsz = 8;
 192                 int peopleLimit = 1000;
 193                 long randomSeed = System.currentTimeMillis();
 194                 Memevil me=null;
 195                 if (args.length > 0)
 196                 {
 197                         try
 198                         {
 199                                 peopleLimit = new Integer(args[0]).intValue();
 200                         }
 201                         catch (NumberFormatException e)
 202                         {
 203                                 throw new TestBug(


< prev index next >