Make special MGC versions of some library class like HashMap and Vector etc. to avoid...
[IRC.git] / Robust / src / ClassLibrary / MGC / Thread.java
1 public class Thread implements Runnable {
2   private boolean finished;
3   Runnable target;
4   
5   public Thread(){
6     finished = false;
7     target = null;
8   }
9   
10   public Thread(Runnable r) {
11     finished = false;
12     target = r;
13   }
14
15   public void start() {
16     nativeCreate();
17   }
18
19   private static void staticStart(Thread t) {
20     t.run();
21   }
22
23   public static native void yield();
24
25   public void join() {
26     nativeJoin();
27   }
28
29   private native void nativeJoin();
30
31   public native static void sleep(long millis);
32
33   public void run() {
34     if(target != null) {
35       target.run();
36     }
37   }
38
39   private native void nativeCreate();
40
41 }