* sreal.h (sreal::shift): Fix sanity check.
[official-gcc.git] / libjava / testsuite / libjava.lang / Thread_Alive.java
blobe885e1624cd1ed0788cdad0d9283b1c89507b202
1 // Test the status of the isAlive() flag before, during, and after thread
2 // execution. Check that thread's threadgroup is null after thread exits.
4 public class Thread_Alive implements Runnable
6 public static void main(String args[]) throws InterruptedException
8 Thread_Alive ta = new Thread_Alive();
9 Thread t = new Thread(ta);
10 System.out.println(t.isAlive());
11 t.start();
12 System.out.println(t.isAlive());
14 Thread.sleep(50);
16 synchronized (ta)
18 ta.notifyAll();
21 t.join();
22 System.out.println(t.isAlive());
24 try
26 t.start();
27 System.out.println("Error: dead thread can be restarted.");
29 catch (IllegalThreadStateException x)
31 System.out.println ("ok");
34 System.out.println(t.getThreadGroup());
37 public synchronized void run()
39 try
41 wait();
43 catch (InterruptedException x) {}