A
Anders Fredborg
Hi !
I have developed an application running on a PDA with PPC2003. The Main Form
starts a Thread that is supposed to run concurrently with the main Thread.
This works Superb. However, when i close the application, it doesnt seem
like the Thread is being Disposed correctly, since I cant restart the
application, until i soft-reset the PDA.
This is how the Object is created, and the thread started in the Main Form:
myRFnetTool = new myRFUtils();
System.Threading.Thread thr = new Thread(new
ThreadStart(myRFnetTool.updateAccessPointsList));
thr.Priority = System.Threading.ThreadPriority.Normal;
thr.Start();
Here is the updateAccessPointsList() procedure of the MyRFNetTool
public void updateAccessPointsList()
{
while(!isDisconnecting)
{
// Here some code is performed
System.Threading.Thread.Sleep(3000);
updateAccessPointsList(); // The method is called recursively
with 3 sec intervals, until the Global Variable "isDisconnecting" is set to
true, which is set at the Objects Dispose function
}
}
How can i make sure the Thread gets disposed more properly? It doesnt seem
to get disposed properly, since i cant restart the Application:
Plz Help.
Regards
Anders
I have developed an application running on a PDA with PPC2003. The Main Form
starts a Thread that is supposed to run concurrently with the main Thread.
This works Superb. However, when i close the application, it doesnt seem
like the Thread is being Disposed correctly, since I cant restart the
application, until i soft-reset the PDA.
This is how the Object is created, and the thread started in the Main Form:
myRFnetTool = new myRFUtils();
System.Threading.Thread thr = new Thread(new
ThreadStart(myRFnetTool.updateAccessPointsList));
thr.Priority = System.Threading.ThreadPriority.Normal;
thr.Start();
Here is the updateAccessPointsList() procedure of the MyRFNetTool
public void updateAccessPointsList()
{
while(!isDisconnecting)
{
// Here some code is performed
System.Threading.Thread.Sleep(3000);
updateAccessPointsList(); // The method is called recursively
with 3 sec intervals, until the Global Variable "isDisconnecting" is set to
true, which is set at the Objects Dispose function
}
}
How can i make sure the Thread gets disposed more properly? It doesnt seem
to get disposed properly, since i cant restart the Application:
Plz Help.
Regards
Anders