![]() |
Stop() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Public Function |
Declared in: Win32Thread.h |
virtual BOOL Stop();
Terminate the thread
try { //Only if suspened or running //Do we have the thread ? if (m_hThread) { //What status are we if (GetThreadStatus()==tsRunning && GetBruteTermination()) //First try to close it if (!TerminateThread(m_hThread,THREAD_DO_NOTHING_EXIT_VALUE)) return FALSE; if (GetThreadStatus()==tsSuspended || GetThreadStatus()==tsRunning) if (CloseHandle(m_hThread)) { //Close the handle m_hThread=NULL; //Stopped SetThreadStatus(tsStopped); //Exit return TRUE; } else return FALSE; else { //Just close the handle if (!CloseHandle(m_hThread)) m_hThread=NULL; //Exit return FALSE; } } else return FALSE; } ERROR_HANDLER_RETURN("Stop",FALSE)
![]() |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |