![]() |
SubmitJob() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Private Function |
Declared in: ThreadPool.h |
Declaration
BOOL SubmitJob(
LPThreadPoolProc pJobProc,
LPThreadDWORDPoolProc pDWORDJobProc,
LPThreadPoolDataProc pDataProc,
LPVOID lpData);
DescriptionSubmit the job localy
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
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. |