M
mehdi
Hi folks,
Consider a class (MyClass) in which one of its methods (named Run) is
supposed to run in another thread, rather than the Main thread. This
class uses the System.Threading.Thread class to get the job done.
Here's the pseudo code:
class MyClass
{
void ExecAsync()
{
Start a given worker thread, say, myThreadProc.
}
void myThreadProc()
{
Run(); //An abstract method.
Fire the events, either the canceled or completed operation...
}
void Cancel()
{
//wait until the thread quits.
}
}
The question is that I've got no idea how to fire those events in the
main thread context. Any idea?
TIA,
Mehdi
Consider a class (MyClass) in which one of its methods (named Run) is
supposed to run in another thread, rather than the Main thread. This
class uses the System.Threading.Thread class to get the job done.
Here's the pseudo code:
class MyClass
{
void ExecAsync()
{
Start a given worker thread, say, myThreadProc.
}
void myThreadProc()
{
Run(); //An abstract method.
Fire the events, either the canceled or completed operation...
}
void Cancel()
{
//wait until the thread quits.
}
}
The question is that I've got no idea how to fire those events in the
main thread context. Any idea?
TIA,
Mehdi