* g++.dg/ipa/ivinline-1.C: Add target nonpic.
[official-gcc.git] / libjava / testsuite / libjava.jvmti / getallthreads.java
blob00be3a75c00277214e252c402b3cbad8d30f4589
1 // Test JVMTI GetAllThreads
3 import java.util.ArrayList;
5 public class getallthreads extends Thread
7 public static int thread_num;
8 public static ArrayList threads;
10 public int ex_frames;
11 public boolean done = false;
13 public static native void do_getallthreads_tests ();
15 public void run ()
17 ex_frames = thread_num;
18 thread_num++;
20 if (ex_frames > 0)
22 if ((ex_frames % 2) == 0)
23 placeholder ();
24 else
25 natPlaceholder ();
27 else
28 runner ();
31 public native void natPlaceholder ();
32 public native void natRunner ();
34 public void placeholder ()
36 ex_frames--;
38 if (ex_frames > 0)
40 if ((thread_num % 2) == 0)
41 placeholder ();
42 else
43 natPlaceholder ();
45 else
46 runner ();
49 public void runner ()
51 done = true;
52 while (done)
53 yield ();
56 public static void main (String[] args)
58 System.out.println ("JVMTI GetAllThreads tests");
59 threads = new ArrayList (20);
61 getallthreads t;
63 for (int i = 0; i < 20; i++)
65 t = new getallthreads ();
66 threads.add (t);
67 t.start ();
68 while (!t.done)
69 yield ();
72 do_getallthreads_tests ();
74 for (int i = 0; i < 20; i++)
76 t = (getallthreads) threads.get(i);
77 t.done = false;