B
Buddy Home
Hello,
I want to understand whats the best way to write code to replace
Thread.Suspend, Thread.Resume and Thread.Abort.
I have lots of code calling these existing methods and want to minimize the
risk of changing the code everywhere so here is what I think I could do,
which is to create my own ThreadWrapper class which inherits from Thread and
which has these three methods already defined but does it a different way
and then my original code can work as normal by just referencing my
ThreadWrapper class.
Example
public class ThreadWrapper : Thread
{
public void Abort()
{
// What do i do here
}
public void Suspend()
{
// What do i do here
}
public void Resume()
{
// What do i do here
}
}
My App
public class Test
{
static void Main(string[] args)
{
ThreadWrapper tw = new ThreadWrapper();
...
tw.Suspend();
tw.Resume();
tw.Abort();
}
}
Thanks,
I want to understand whats the best way to write code to replace
Thread.Suspend, Thread.Resume and Thread.Abort.
I have lots of code calling these existing methods and want to minimize the
risk of changing the code everywhere so here is what I think I could do,
which is to create my own ThreadWrapper class which inherits from Thread and
which has these three methods already defined but does it a different way
and then my original code can work as normal by just referencing my
ThreadWrapper class.
Example
public class ThreadWrapper : Thread
{
public void Abort()
{
// What do i do here
}
public void Suspend()
{
// What do i do here
}
public void Resume()
{
// What do i do here
}
}
My App
public class Test
{
static void Main(string[] args)
{
ThreadWrapper tw = new ThreadWrapper();
...
tw.Suspend();
tw.Resume();
tw.Abort();
}
}
Thanks,