I have managed C++ code in which i am using Thread.
I have started Thread like below
ThreadStart* threadStart = new ThreadStart(pThread, CThread::MyFile);
Thread* oThread = new Thread(threadstart);
Once my requested job done. I have to stop thread. How can i do this?
Is it really required to stop the thread? I was assuming that once my requested job will done, Thread will automatically stop itself.
Please see my comments to the question. As you say "once my requested job is done", you don't need to do anything.—SA
The thread will exit the method
threadstart and it will stop it.
As to the object
oThread, it will be destroyed by GC eventually, after the object becomes unreacheable.
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)