VirtualBox

Ignore:
Timestamp:
Apr 15, 2008 1:53:12 PM (17 years ago)
Author:
vboxsync
Message:

Main: Implemented true AutoReaderLock (#2768).

File:
1 edited

Legend:

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

    r6168 r7992  
    163163 *  Loads settings from the given port node.
    164164 *  May be called once right after this object creation.
    165  * 
     165 *
    166166 *  @param aPortNode <Port> node.
    167  * 
     167 *
    168168 *  @note Locks this object for writing.
    169169 */
     
    188188     * place when a setting of a newly created object must default to A while
    189189     * the same setting of an object loaded from the old settings file must
    190      * default to B. */ 
     190     * default to B. */
    191191
    192192    /* enabled (required) */
     
    206206}
    207207
    208 /** 
     208/**
    209209 *  Saves settings to the given port node.
    210  * 
     210 *
    211211 *  Note that the given Port node is comletely empty on input.
    212212 *
    213213 *  @param aPortNode <Port> node.
    214  * 
    215  *  @note Locks this object for reading. 
     214 *
     215 *  @note Locks this object for reading.
    216216 */
    217217HRESULT ParallelPort::saveSettings (settings::Key &aPortNode)
     
    272272
    273273    /* sanity too */
    274     AutoCaller thatCaller (mPeer);
    275     AssertComRCReturnVoid (thatCaller.rc());
    276 
    277     /* lock both for writing since we modify both */
    278     AutoMultiLock <2> alock (this->wlock(), AutoLock::maybeWlock (mPeer));
     274    AutoCaller peerCaller (mPeer);
     275    AssertComRCReturnVoid (peerCaller.rc());
     276
     277    /* lock both for writing since we modify both (mPeer is "master" so locked
     278     * first) */
     279    AutoMultiWriteLock2 alock (mPeer, this);
    279280
    280281    if (mData.isBackedUp())
     
    302303
    303304    /* sanity too */
    304     AutoCaller thatCaller (mPeer);
     305    AutoCaller thatCaller (aThat);
    305306    AssertComRCReturnVoid (thatCaller.rc());
    306307
    307     /* peer is not modified, lock it for reading */
    308     AutoMultiLock <2> alock (this->wlock(), aThat->rlock());
     308    /* peer is not modified, lock it for reading (aThat is "master" so locked
     309     * first) */
     310    AutoMultiLock2 alock (aThat->rlock(), this->wlock());
    309311
    310312    /* this will back up current data */
     
    504506}
    505507
    506 /** 
     508/**
    507509 *  Validates COMSETTER(Path) arguments.
    508510 */
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