Alachisoft.NCache.Common.Threading.ThreadClass Maven / Gradle / Ivy
package Alachisoft.NCache.Common.Threading;
//Basit: Not used and dont need
/**
* Support class used to handle threads
*/
public class ThreadClass //implements IThreadRunnable
{
//
// /**
// * The instance of Thread
// */
// private Thread threadField;
//
// /**
// * Initializes a new instance of the ThreadClass class
// */
// public ThreadClass()
// {
// threadField = new Thread(new ThreadStart(Run));
// }
//
// /**
// * Initializes a new instance of the Thread class.
// *
// * @param Name The name of the thread
// */
// public ThreadClass(String Name)
// {
// threadField = new Thread(new ThreadStart(Run));
// this.setName(Name);
// }
//
// /**
// * Initializes a new instance of the Thread class.
// *
// * @param Start A ThreadStart delegate that references the methods to be invoked when this thread begins executing
// */
// public ThreadClass(ThreadStart Start)
// {
// threadField = new Thread(Start);
// }
//
// /**
// * Initializes a new instance of the Thread class.
// *
// * @param Start A ThreadStart delegate that references the methods to be invoked when this thread begins executing
// * @param Name The name of the thread
// */
// public ThreadClass(ThreadStart Start, String Name)
// {
// threadField = new Thread(Start);
// this.setName(Name);
// }
//
// /**
// * This method has no functionality unless the method is overridden
// */
// public void Run()
// {
// }
//
// /**
// * Causes the operating system to change the state of the current thread instance to ThreadState.Running
// */
// public void Start()
// {
// threadField.start();
// }
//
// /**
// * Interrupts a thread that is in the WaitSleepJoin thread state
// */
// public void Interrupt()
// {
// threadField.interrupt();
// }
//
// /**
// * Gets or sets the name of the thread
// */
// public final String getName()
// {
// return threadField.Name;
// }
//
// public final void setName(String value)
// {
// if (threadField.Name == null)
// {
// threadField.Name = value;
// }
// }
//
// /**
// * Gets or sets a value indicating the scheduling priority of a thread
// */
// public final ThreadPriority getPriority()
// {
// return threadField.Priority;
// }
//
// public final void setPriority(ThreadPriority value)
// {
// threadField.Priority = value;
// }
//
// /**
// * Gets a value indicating the execution status of the current thread
// */
// public final boolean getIsAlive()
// {
// return threadField.isAlive();
// }
//
// /**
// * Gets a value indicating the execution status of the current thread
// */
// public final boolean getIsInterrupted()
// {
// return (threadField.ThreadState & ThreadState.WaitSleepJoin) == ThreadState.WaitSleepJoin;
// }
//
// /**
// * Gets or sets a value indicating whether or not a thread is a background thread.
// */
// public final boolean getIsBackground()
// {
// return threadField.IsBackground;
// }
//
// public final void setIsBackground(boolean value)
// {
// threadField.IsBackground = value;
// }
//
// /**
// * Blocks the calling thread until a thread terminates
// */
// public final void Join()
// {
// threadField.join();
// }
//
// /**
// * Blocks the calling thread until a thread terminates or the specified time elapses
// *
// * @param MiliSeconds Time of wait in milliseconds
// */
// public final void Join(long MiliSeconds)
// {
// synchronized (this)
// {
// threadField.join(new System.TimeSpan(MiliSeconds * 10000));
// }
// }
//
// /**
// * Blocks the calling thread until a thread terminates or the specified time elapses
// *
// * @param MiliSeconds Time of wait in milliseconds
// * @param NanoSeconds Time of wait in nanoseconds
// */
// public final void Join(long MiliSeconds, int NanoSeconds)
// {
// synchronized (this)
// {
// threadField.join(new System.TimeSpan(MiliSeconds * 10000 + NanoSeconds * 100));
// }
// }
//
// /**
// * Resumes a thread that has been suspended
// */
// public final void Resume()
// {
// threadField.resume();
// }
//
// /**
// * Raises a ThreadAbortException in the thread on which it is invoked, to begin the process of terminating the thread. Calling this method usually terminates the thread
// */
// public final void Abort()
// {
// threadField.stop();
// }
//
// /**
// * Raises a ThreadAbortException in the thread on which it is invoked, to begin the process of terminating the thread while also providing exception information about the
// * thread termination. Calling this method usually terminates the thread.
// *
// * @param stateInfo An object that contains application-specific information, such as state, which can be used by the thread being aborted
// */
// public final void Abort(Object stateInfo)
// {
// synchronized (this)
// {
// threadField.Abort(stateInfo);
// }
// }
//
// /**
// * Suspends the thread, if the thread is already suspended it has no effect
// */
// public final void Suspend()
// {
// threadField.suspend();
// }
//
// /**
// * Obtain a String that represents the current Object
// *
// * @return A String that represents the current Object
// */
// @Override
// public String toString()
// {
// return "Thread[" + getName() + "," + getPriority().toString() + "," + "" + "]";
// }
//
// /**
// * Gets the currently running thread
// *
// * @return The currently running thread
// */
// public static ThreadClass Current()
// {
// ThreadClass CurrentThread = new ThreadClass();
// CurrentThread.threadField = Thread.currentThread();
// return CurrentThread;
// }
}