Bug fix. Now the SPECjbb2005 can run with small workload that does not invoke gc
[IRC.git] / Robust / src / ClassLibrary / MGC / Thread.java
index 14ed23e539a67f83bc537b8ec92da028745b00e6..f329774e0ff49a82a538b3ca2bcc7e9aad10a85b 100644 (file)
@@ -18,6 +18,7 @@ public class Thread implements Runnable {
 
   private static void staticStart(Thread t) {
     t.run();
+    t.finished = true;
   }
 
   public static native void yield();
@@ -34,10 +35,13 @@ public class Thread implements Runnable {
     if(target != null) {
       target.run();
     }
+    this.finished = true;
   }
 
   private native void nativeCreate();
   
-  public final native boolean isAlive();
+  public final boolean isAlive() {
+    return !this.finished;
+  }
 
 }