Abt thread

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.
 
?

=?ISO-8859-1?Q?G=F6ran_Andersson?=

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top