VirtualBox

Changeset 25881 in vbox


Ignore:
Timestamp:
Jan 18, 2010 11:29:12 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56689
Message:

Main: remove unused and broken autolock code

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/AutoLock.h

    r25880 r25881  
    388388 *
    389389 * In addition to utility methods for subclasses, this implements the public
    390  * leave/enter/maybeLeave/maybeEnter methods, which are common to all
     390 * leave/enter/maybeEnter methods, which are common to all
    391391 * write locks.
    392392 */
     
    417417    void leave();
    418418    void enter();
    419     void maybeLeave();
    420419    void maybeEnter();
    421420};
  • trunk/src/VBox/Main/glue/AutoLock.cpp

    r25880 r25881  
    625625
    626626/**
    627  * Same as #leave() but checks if the current thread actally owns the lock
    628  * and only proceeds in this case. As a result, as opposed to #leave(),
    629  * doesn't assert when called with no lock being held.
    630  */
    631 void AutoWriteLockBase::maybeLeave()
    632 {
    633     // unlock in reverse order!
    634     uint32_t i = m->aHandles.size();
    635     for (HandlesVector::reverse_iterator it = m->aHandles.rbegin();
    636          it != m->aHandles.rend();
    637          ++it)
    638     {
    639         --i;            // array index is zero based, decrement with every loop since we iterate backwards
    640         LockHandle *pHandle = *it;
    641         if (pHandle)
    642         {
    643             if (pHandle->isWriteLockOnCurrentThread())
    644             {
    645                 m->acUnlockedInLeave[i] = pHandle->writeLockLevel();
    646                 AssertMsg(m->acUnlockedInLeave[i] >= 1, ("m->cUnlockedInLeave[%d] is %d, must be >=1!", i, m->acUnlockedInLeave[i]));
    647 
    648                 for (uint32_t left = m->acUnlockedInLeave[i];
    649                      left;
    650                      --left)
    651                     callUnlockImpl(*pHandle);
    652             }
    653         }
    654         ++i;
    655     }
    656 }
    657 
    658 /**
    659627 * Same as #enter() but checks if the current thread actally owns the lock
    660628 * and only proceeds if not. As a result, as opposed to #enter(), doesn't
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette