23 using System.Threading;
25 namespace Lucene.Net.Support
35 private System.Threading.Thread threadField;
43 threadField =
new System.Threading.Thread(
new System.Threading.ThreadStart(Run));
52 threadField =
new System.Threading.Thread(
new System.Threading.ThreadStart(Run));
62 threadField =
new System.Threading.Thread(Start);
70 public ThreadClass(System.Threading.ThreadStart Start, System.String Name)
72 threadField =
new System.Threading.Thread(Start);
79 public virtual void Run()
86 public virtual void Start()
94 public virtual void Interrupt()
96 threadField.Interrupt();
102 public System.Threading.Thread Instance
117 public System.String Name
121 return threadField.Name;
125 if (threadField.Name == null)
126 threadField.Name = value;
130 public void SetDaemon(
bool isDaemon)
132 threadField.IsBackground = isDaemon;
138 public System.Threading.ThreadPriority Priority
144 return threadField.Priority;
148 return ThreadPriority.Normal;
155 threadField.Priority = value;
169 return threadField.IsAlive;
176 public bool IsBackground
180 return threadField.IsBackground;
184 threadField.IsBackground = value;
200 public void Join(
long MiliSeconds)
202 threadField.Join(
new System.TimeSpan(MiliSeconds * 10000));
210 public void Join(
long MiliSeconds,
int NanoSeconds)
212 threadField.Join(
new System.TimeSpan(MiliSeconds * 10000 + NanoSeconds * 100));
220 Monitor.PulseAll(threadField);
240 public void Abort(
object stateInfo)
242 threadField.Abort(stateInfo);
248 public void Suspend()
250 Monitor.Wait(threadField);
257 public override System.String ToString()
259 return "Thread[" + Name +
"," + Priority.ToString() +
"]";
271 public static void Sleep(
long ms)
275 Thread.Sleep((
int)ms);
287 This.Instance = Thread.CurrentThread;
294 if (((
object)t1) == null)
return t2 == null;
295 return t1.Equals(t2);
303 public override bool Equals(
object obj)
305 if (obj == null)
return false;
306 if (obj is
ThreadClass)
return this.threadField.Equals(((ThreadClass)obj).threadField);
310 public override int GetHashCode()
312 return this.threadField.GetHashCode();