V
Venue
I followed the sample and have my one class calling two threads (from two
methods) and another thread from another class.
When I run my code in debug mode I see that this.CloseMe() gets called only
once although I have the line < this.Invoke (new
EventHandler(this.CloseMe)); > in all my methods calling threads. I tried
creating two different methods for closing i.e. CloseMe1 and CloseMe2 but
only one of them gets called ( I guess the thread that completes first).
Does that mean other thread gets aborted (even in the other class where I
start the thread doesn't get executed).
Does that mean that this.CloseMe should be called only when the application
is about to shut down. But then how do I get rid of the thread which
finished the job it was assigned to do.
Also, will it be sufficient to just return from the method which is being
called by thread when certain condition is true.
methods) and another thread from another class.
When I run my code in debug mode I see that this.CloseMe() gets called only
once although I have the line < this.Invoke (new
EventHandler(this.CloseMe)); > in all my methods calling threads. I tried
creating two different methods for closing i.e. CloseMe1 and CloseMe2 but
only one of them gets called ( I guess the thread that completes first).
Does that mean other thread gets aborted (even in the other class where I
start the thread doesn't get executed).
Does that mean that this.CloseMe should be called only when the application
is about to shut down. But then how do I get rid of the thread which
finished the job it was assigned to do.
Also, will it be sufficient to just return from the method which is being
called by thread when certain condition is true.