VirtualBox

Ignore:
Timestamp:
Jun 22, 2010 2:01:01 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
62978
Message:

Main: do not hold any other lock while calling VirtualBox::saveSettings (mostly comments, only real change is in DHCPServer); also, VirtualBox lock is not needed in SessionMachine::endSavingState

File:
1 edited

Legend:

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

    r28800 r30377  
    150150    if (FAILED(autoCaller.rc())) return autoCaller.rc();
    151151
    152     /* VirtualBox::saveSettings() needs a write lock */
    153     AutoMultiWriteLock2 alock(mVirtualBox, this COMMA_LOCKVAL_SRC_POS);
    154 
     152    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    155153    m.enabled = aEnabled;
    156154
     155    // save the global settings; for that we should hold only the VirtualBox lock
     156    alock.release();
     157    AutoWriteLock vboxLock(mVirtualBox COMMA_LOCKVAL_SRC_POS);
    157158    HRESULT rc = mVirtualBox->saveSettings();
    158159
     
    218219    if (FAILED(autoCaller.rc())) return autoCaller.rc();
    219220
    220     /* VirtualBox::saveSettings() needs a write lock */
    221     AutoMultiWriteLock2 alock(mVirtualBox, this COMMA_LOCKVAL_SRC_POS);
    222 
     221    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    223222    m.IPAddress = aIPAddress;
    224223    m.networkMask = aNetworkMask;
     
    226225    m.upperIP = aUpperIP;
    227226
     227    // save the global settings; for that we should hold only the VirtualBox lock
     228    alock.release();
     229    AutoWriteLock vboxLock(mVirtualBox COMMA_LOCKVAL_SRC_POS);
    228230    return mVirtualBox->saveSettings();
    229231}
Note: See TracChangeset for help on using the changeset viewer.

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