59 System.out.println ("TestThread.");
60 testing = true;
61 }
62 }
63
64 class TestThreadStarter extends Thread {
65 public void run() {
66 System.out.println ("TestThreadStarter.");
67 starting=true;
68 testThread.start();
69 }
70 }
71
72 class GCThread extends Thread {
73 public void run() {
74 System.out.println ("GCThread run.");
75 synchronized (testThread) {
76 System.out.println ("GCThread synchronized.");
77 while (!done) {
78 gcing=true;
79 yield();
80 System.gc();
81 }
82 }
83 System.out.println ("GCThread done.");
84 }
85 }
86
87 TestThread testThread = new TestThread();
88 boolean done = false;
89 boolean gcing = false;
90 boolean testing = false;
91 boolean starting = false;
92 }
|
59 System.out.println ("TestThread.");
60 testing = true;
61 }
62 }
63
64 class TestThreadStarter extends Thread {
65 public void run() {
66 System.out.println ("TestThreadStarter.");
67 starting=true;
68 testThread.start();
69 }
70 }
71
72 class GCThread extends Thread {
73 public void run() {
74 System.out.println ("GCThread run.");
75 synchronized (testThread) {
76 System.out.println ("GCThread synchronized.");
77 while (!done) {
78 gcing=true;
79 Thread.yield();
80 System.gc();
81 }
82 }
83 System.out.println ("GCThread done.");
84 }
85 }
86
87 TestThread testThread = new TestThread();
88 boolean done = false;
89 boolean gcing = false;
90 boolean testing = false;
91 boolean starting = false;
92 }
|