Class CThreadPool::
SubmitJob()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: SpawnThreadsNext page: SubmitJob    Show member index
Private Function Declared in:
ThreadPool.h

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

BOOL SubmitJob(
    LPThreadPoolProc pJobProc,
    LPThreadDWORDPoolProc pDWORDJobProc,
    LPThreadPoolDataProc pDataProc,
    LPVOID lpData);

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

Submit the job localy

'Function Body' icon -- Shortcut to top of page. Function Body

try
{
    //Did we release
    BOOL bRelease;
    bRelease=FALSE;

    //Job data, not to do inside CS
    JobData aData;
    aData.pProc=pJobProc;
    aData.pDWORDProc=pDWORDJobProc;
    aData.pDataProc=pDataProc;
    aData.pParam=lpData;

    //Lock it
    CCriticalAutoRelease aRelease(m_pCSection);

    //Are we full ?
    if (m_ulJobsCount>=m_iMaxJobsPending &&
        m_bDrop)
        //Quit
        return FALSE;

    //Add it
    m_aJobList.push_back(aData);

    //Increase the number of jobs we have
    ++m_ulJobsCount;

    //Exit the CS
    aRelease.Exit();

    //And release a semaphore (if we have a big back log it will stick it)
    while (m_pSemaphore->Release()==-1)
        Sleep(m_dwSleepInterval);

    //Everything is OK
    return TRUE;
}
ERROR_HANDLER_RETURN("SubmitJob",FALSE)

'See Also' icon -- Shortcut to top of page. See Also

Class Overview Class Overview  |  Public base class CErrorHandler  |  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.