VirtualBox

Changeset 86595 in vbox


Ignore:
Timestamp:
Oct 16, 2020 7:18:45 AM (4 years ago)
Author:
vboxsync
Message:

Audio/DrvAudio: Leave and re-enter the driver's critical section when calling drvAudioDevicesEnumerateInternal() via drvAudioStreamMaybeReInit() to avoid deadlocks with the IMMNotificationClient implementation callback. bugref:8658

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DrvAudio.cpp

    r86563 r86595  
    11161116 * Re-initializes the given stream if it is scheduled for this operation.
    11171117 *
     1118 * @note This caller must have entered the critical section of the driver instance,
     1119 *       needed for the host device (re-)enumeration.
     1120 *
    11181121 * @param   pThis               Pointer to driver instance.
    11191122 * @param   pStream             Stream to check and maybe re-initialize.
     
    11331136            if (pThis->fEnumerateDevices)
    11341137            {
     1138                /* Make sure to leave the driver's critical section before enumerating host stuff. */
     1139                int rc2 = RTCritSectLeave(&pThis->CritSect);
     1140                AssertRC(rc2);
     1141
    11351142                /* Re-enumerate all host devices. */
    11361143                drvAudioDevicesEnumerateInternal(pThis, true /* fLog */, NULL /* pDevEnum */);
     1144
     1145                /* Re-enter the critical section again. */
     1146                rc2 = RTCritSectEnter(&pThis->CritSect);
     1147                AssertRC(rc2);
    11371148
    11381149                pThis->fEnumerateDevices = false;
     
    20972108 * VERR_NOT_SUPPORTED if not being supported.
    20982109 *
     2110 * @note Must not hold the driver's critical section!
     2111 *
    20992112 * @returns IPRT status code.
    21002113 * @param   pThis               Driver instance to be called.
     
    21042117static int drvAudioDevicesEnumerateInternal(PDRVAUDIO pThis, bool fLog, PPDMAUDIODEVICEENUM pDevEnum)
    21052118{
     2119    AssertReturn(RTCritSectIsOwned(&pThis->CritSect) == false, VERR_WRONG_ORDER);
     2120
    21062121    int rc;
    21072122
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