Logo Search packages:      
Sourcecode: virtualbox-ose version File versions  Download package

void util::AutoLockBase::cleanup (  )  [protected, inherited]

Destructor implementation that can also be called explicitly, if required. Restores the exact state before the AutoLock was created; that is, unlocks all contained semaphores and might actually lock them again if leave() was called during the AutoLock's lifetime.

Definition at line 419 of file AutoLock.cpp.

References util::AutoLockBase::callUnlockOnAllHandles().

Referenced by util::AutoWriteLock::attach(), and util::AutoWriteLock::~AutoWriteLock().

    bool fAnyUnlockedInLeave = false;

    uint32_t i = 0;
    for (HandlesVector::iterator it = m->aHandles.begin();
         it != m->aHandles.end();
        LockHandle *pHandle = *it;
        if (pHandle)
            if (m->acUnlockedInLeave[i])
                // there was a leave() before the destruction: then restore the
                // lock level that might have been set by locks other than our own
                if (m->fIsLocked)
                    fAnyUnlockedInLeave = true;
                for (; m->acUnlockedInLeave[i]; --m->acUnlockedInLeave[i])

    if (m->fIsLocked && !fAnyUnlockedInLeave)

Generated by  Doxygen 1.6.0   Back to index