Abt thread

  • Thread starter Thread starter malu
  • Start date Start date
M

malu

Hi

I faced one exception when use the thread in c#. I start the thread
in a class.Then i start the thread thru the main method constructor.In
that thred i use the thred.sleep() method.

Then one button i place in my project.That purpose is stop all
functions ans close my application.In that button i call the Dispose()
method.In that Dispose(0 method i call the thread.abort method.

but i face the exception.

System.Threading.ThreadAbortException + Thread was being
aborted

Plz give any suggestion for solving it.
 
malu said:
Hi

I faced one exception when use the thread in c#. I start the thread
in a class.Then i start the thread thru the main method constructor.In
that thred i use the thred.sleep() method.

Then one button i place in my project.That purpose is stop all
functions ans close my application.In that button i call the Dispose()
method.In that Dispose(0 method i call the thread.abort method.

but i face the exception.

System.Threading.ThreadAbortException + Thread was being
aborted

Plz give any suggestion for solving it.

Trowing a ThreadAbortException in the thread is the way that the thread
is aborted. The thread can handle being aborted by catching the exception.
 
Back
Top