VirtualBox

Ignore:
Timestamp:
Apr 15, 2008 1:53:12 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
29646
Message:

Main: Implemented true AutoReaderLock (#2768).

File:
1 edited

Legend:

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

    r7939 r7992  
    24912491
    24922492/**
    2493  *  Called by IInternalSessionControl::OnDVDDriveChange().
    2494  *
    2495  *  @note Locks this object for reading.
     2493 * Called by IInternalSessionControl::OnDVDDriveChange().
     2494 *
     2495 * @note Locks this object for writing.
    24962496 */
    24972497HRESULT Console::onDVDDriveChange()
     
    25022502    AssertComRCReturnRC (autoCaller.rc());
    25032503
    2504     AutoReaderLock alock (this);
     2504    /* doDriveChange() needs a write lock */
     2505    AutoLock alock (this);
    25052506
    25062507    /* Ignore callbacks when there's no VM around */
     
    25872588
    25882589/**
    2589  *  Called by IInternalSessionControl::OnFloppyDriveChange().
    2590  *
    2591  *  @note Locks this object for reading.
     2590 * Called by IInternalSessionControl::OnFloppyDriveChange().
     2591 *
     2592 * @note Locks this object for writing.
    25922593 */
    25932594HRESULT Console::onFloppyDriveChange()
     
    25982599    AssertComRCReturnRC (autoCaller.rc());
    25992600
    2600     AutoReaderLock alock (this);
     2601    /* doDriveChange() needs a write lock */
     2602    AutoLock alock (this);
    26012603
    26022604    /* Ignore callbacks when there's no VM around */
     
    27042706 * @param   fPassthrough    Enables using passthrough mode of the host DVD drive if applicable.
    27052707 *
    2706  * @note Locks this object for reading.
     2708 * @note Locks this object for writing.
    27072709 */
    27082710HRESULT Console::doDriveChange (const char *pszDevice, unsigned uInstance, unsigned uLun, DriveState_T eState,
     
    27172719    AssertComRCReturnRC (autoCaller.rc());
    27182720
    2719     AutoReaderLock alock (this);
     2721    /* We will need to release the write lock before calling EMT */
     2722    AutoLock alock (this);
    27202723
    27212724    /* protect mpVM */
     
    27842787 *
    27852788 * @thread  EMT
    2786  * @note Locks the Console object for writing
     2789 * @note Locks the Console object for writing.
    27872790 */
    27882791DECLCALLBACK(int) Console::changeDrive (Console *pThis, const char *pszDevice, unsigned uInstance, unsigned uLun,
     
    28052808
    28062809    /*
    2807      *  Locking the object before doing VMR3* calls is quite safe here,
    2808      *  since we're on EMT. Write lock is necessary because we're indirectly
    2809      *  modify the meDVDState/meFloppyState members (pointed to by peState).
     2810     * Locking the object before doing VMR3* calls is quite safe here, since
     2811     * we're on EMT. Write lock is necessary because we indirectly modify the
     2812     * meDVDState/meFloppyState members (pointed to by peState).
    28102813     */
    28112814    AutoLock alock (pThis);
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