00001 using System;
00002 using System.Threading;
00003 using Threading = System.Threading;
00004
00005 namespace Tamir.SharpSsh.java.lang
00006 {
00010 public class Thread
00011 {
00012 Threading.Thread t;
00013
00014 public Thread(Threading.Thread t)
00015 {
00016 this.t=t;
00017 }
00018 public Thread(ThreadStart ts):this(new Threading.Thread(ts))
00019 {
00020 }
00021
00022 public Thread(Runnable r):this(new ThreadStart(r.run))
00023 {
00024 }
00025
00026 public void setName(string name)
00027 {
00028 t.Name=name;
00029 }
00030
00031 public void start()
00032 {
00033 t.Start();
00034 }
00035
00036 public bool isAlive()
00037 {
00038 return t.IsAlive;
00039 }
00040
00041 public void yield()
00042 {
00043 }
00044
00045 public void interrupt()
00046 {
00047 try
00048 {
00049 t.Interrupt();
00050 }catch
00051 {
00052 }
00053 }
00054
00055 public void notifyAll()
00056 {
00057 Monitor.PulseAll(this);
00058 }
00059
00060 public static void Sleep(int t)
00061 {
00062 Threading.Thread.Sleep(t);
00063 }
00064
00065 public static void sleep(int t)
00066 {
00067 Sleep(t);
00068 }
00069
00070 public static Thread currentThread()
00071 {
00072 return new Thread( Threading.Thread.CurrentThread );
00073 }
00074 }
00075 }