VirtualBox

Changeset 31388 in vbox


Ignore:
Timestamp:
Aug 5, 2010 10:26:18 AM (14 years ago)
Author:
vboxsync
Message:

Main: locking optimization

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/HostImpl.cpp

    r31387 r31388  
    529529    if (FAILED(autoCaller.rc())) return autoCaller.rc();
    530530
    531     std::list <ComObjPtr<HostNetworkInterface> > list;
     531    std::list<ComObjPtr<HostNetworkInterface> > list;
    532532
    533533# ifdef VBOX_WITH_HOSTNETIF_API
     
    14811481    AutoMultiWriteLock2 alock(this->lockHandle(), &m->usbListsLock COMMA_LOCKVAL_SRC_POS);
    14821482
    1483 
    14841483    for (settings::USBDeviceFiltersList::const_iterator it = data.llUSBDeviceFilters.begin();
    14851484         it != data.llUSBDeviceFilters.end();
     
    15141513    if (FAILED(autoCaller.rc())) return autoCaller.rc();
    15151514
    1516     AutoReadLock alock1(this COMMA_LOCKVAL_SRC_POS);
    1517     AutoReadLock alock2(&m->usbListsLock COMMA_LOCKVAL_SRC_POS);
     1515    AutoReadLock alock(&m->usbListsLock COMMA_LOCKVAL_SRC_POS);
    15181516
    15191517    data.llUSBDeviceFilters.clear();
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r31387 r31388  
    31853185    try
    31863186    {
    3187         // lock the lists while we're here
    3188         AutoReadLock machinesLock(m->allMachines.getLockHandle() COMMA_LOCKVAL_SRC_POS);
    3189 
    31903187        // machines
    31913188        settings::MachinesRegistry machinesTemp;
    31923189        {
     3190            AutoReadLock machinesLock(m->allMachines.getLockHandle() COMMA_LOCKVAL_SRC_POS);
    31933191            for (MachinesOList::iterator it = m->allMachines.begin();
    31943192                 it != m->allMachines.end();
     
    32743272        }
    32753273
     3274        mediaLock.release();
     3275
    32763276        settings::DHCPServersList dhcpServersTemp;
    32773277        {
     
    32973297        // leave extra data alone, it's still in the config file
    32983298
    3299         /* host data (USB filters), will take host lock. */
    3300         {
    3301             mediaLock.release();
    3302             machinesLock.release();
    3303             rc = m->pHost->saveSettings(m->pMainConfigFile->host);
    3304             if (FAILED(rc)) throw rc;
    3305         }
     3299        // host data (USB filters)
     3300        rc = m->pHost->saveSettings(m->pMainConfigFile->host);
     3301        if (FAILED(rc)) throw rc;
    33063302
    33073303        rc = m->pSystemProperties->saveSettings(m->pMainConfigFile->systemProperties);
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