Class CWin32ReadWriteLock::
Escalate()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: ~CWin32ReadWriteLockNext page: LockRead    Show member index
Public Function Declared in:
Win32ReadWriteLock.h

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

virtual BOOL Escalate(
    unsigned long ulMSTimeout,
    unsigned long ulIterations);

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

Escalate write priority

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

//Try to lock for write
if (LockWrite())
    return TRUE;

//Try to escalate
CMutexAutoRelease aRelease(m_pMutex,TRUE);

//Change the escalation status
m_bEscalation=TRUE;

//Exit from the mutex
aRelease.Release();

//And wait to see if we can continue
for (unsigned long ulCounter=0;ulCounter<ulIterations;++ulCounter)
{
    //Can we write
    if (LockWrite())
        return TRUE;

    //Wait
    Sleep(ulMSTimeout);
}

//Failed to escalate
return FALSE;

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

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