The class Thread
is a sealed class meaning it cannot be inherited from and I need an instance of a reusable Thread
that should inherit from the
A preferable alternative to using Inheritance is to use Composition. Create your class and have a member of type Thread
. Then map the methods of your class to call methods from the Thread member and add any other methods you may wish. Example:
public class MyThread
{
private Thread thread;
// constructors
public void Join()
{
thread.Join();
}
// whatever else...
}