![]() |
Stop() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Public Function |
Declared in: Win32Thread.h |
Declarationvirtual BOOL Stop();
DescriptionTerminate the thread
Function Body
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)
See Also
This web site was generated
using Surveyor V4.50.811.1. Click
here
for more information. |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |