Class CWin32Thread::
Stop()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: StartNext page: Win32Thread    Show member index
Public Function Declared in:
Win32Thread.h

'Declaration' icon -- Shortcut to top of page. Declaration

virtual BOOL Stop();

'Description' icon -- Shortcut to top of page. Description

Terminate the thread

'Function Body' icon -- Shortcut to top of page. 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' icon -- Shortcut to top of page. See Also

Class Overview Class Overview  |  Public base class CGenericThread  |  Hierarchy Chart Hierarchy Chart


Get Surveyor!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.