class btest extends Thread
{

  public void run()
    {
      System.out.println(isAlive()+" 1");
    }
}

public class DeadThread
{
  public static void main(String args[])
    {
      btest b=null;
      int c = 0;
        
      b = new btest();
      b.start();
      while(b.isAlive() && c < 10)
        {
          System.out.println(++c+" "+b.isAlive());
          try{Thread.sleep(1000);}catch(InterruptedException e){}
        }
    }
}

@@ -51,24 +51,46 @@
     %7B%0A      
+synchronized(this) %7B%0A%09
 System.out.p
@@ -113,16 +113,24 @@
 +%22 1%22);%0A
+      %7D%0A
     %7D%0A%7D%0A
@@ -268,24 +268,50 @@
 ew btest();%0A
+      synchronized(b) %7B%0A  
       b.star
@@ -311,24 +311,26 @@
  b.start();%0A
+  
       while(
@@ -431,20 +431,14 @@
 try%7B
-Thread.sleep
+b.wait
 (100
@@ -475,24 +475,32 @@
  e)%7B%7D%0A        %7D%0A
+      %7D%0A
     %7D%0A%7D%0A

make output deterministic.