Hi. I'm working on a project in which use a BackGroundWorke r control between two forms.
I need to Cancel and immediately to restart the BackGroundorker from the same event. The problem is that: when BackGroundWorke r.CancelAsync() , apparently the thread does not cancel and when it gets to BackGroundWorke r.RunWorkerAsyn c(), the exception "BackgroundWork er is busy" is thrown.
So, how can I cancel and restart the backgroundworke r from the same event.
(Note: I tried with the Threading Class too and I got a similar problem. When use Thread.Abort() or Thread.Suspende d(), the thread is stopped but it cannot restart again.)
I need to Cancel and immediately to restart the BackGroundorker from the same event. The problem is that: when BackGroundWorke r.CancelAsync() , apparently the thread does not cancel and when it gets to BackGroundWorke r.RunWorkerAsyn c(), the exception "BackgroundWork er is busy" is thrown.
So, how can I cancel and restart the backgroundworke r from the same event.
(Note: I tried with the Threading Class too and I got a similar problem. When use Thread.Abort() or Thread.Suspende d(), the thread is stopped but it cannot restart again.)
Comment