Class CWaitList::
Wait()
Data ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: SetAutoReleaseNext page: Custom Code in Header Before Includes    Show member index
Public Function Declared in:
WaitList.h

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

BOOL Wait(
    BOOL bWaitAll,
    DWORD& dwSignaledObject,
    unsigned long ulTimeout=INFINITE);

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

Wait on an object bWaitAll - False, wait for any object
         TRUE, wait to all objects dwSignaledObject - Object signaled (bWaitAll is FALSE) ulTimeout - Timeout to wait (MS) Returns TRUE if timeout

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

//Put invalid value in the signaled object
dwSignaledObject=MAXIMUM_WAIT_OBJECTS;

//Check we have objects
if (!m_ulWaitCount)
    return FALSE;

//And wait
DWORD dwResult;
dwResult=WaitForMultipleObjects(m_ulWaitCount,
                                m_aHandles,
                                bWaitAll,
                                ulTimeout);

//check why we exited
if (dwResult==WAIT_TIMEOUT)
    return TRUE;

//Check which object
if (dwResult>=WAIT_OBJECT_0 &&
    dwResult<WAIT_OBJECT_0+m_ulWaitCount)
{
    //Set the signaled object
    dwSignaledObject=dwResult-WAIT_OBJECT_0;

    //Do we need to build a list ?
    if (m_bAutoRelease)
        if (bWaitAll)
            BuildAutoRelease(0);
        else
            BuildAutoRelease(dwSignaledObject+1);

    //Exit
    return FALSE;
}

//Abandon stuff, don't need it
return FALSE;

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

Class Overview Class Overview  |  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.