VirtualBox

Changeset 82420 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Dec 5, 2019 1:51:16 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
135257
Message:

DevHDA: The HDASTREAM::CritSect is not needed unless VBOX_WITH_AUDIO_HDA_ASYNC_IO is defined, the critical section of the device will take care of the serializing then. The hdaR3StreamLock/Unlock functions are left as no-ops (strict builds checks for device critsect ownership). bugref:9218

Location:
trunk/src/VBox/Devices/Audio
Files:
2 edited

Legend:

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

    r82418 r82420  
    4848int hdaR3StreamCreate(PHDASTREAM pStream, PHDASTATE pThis, uint8_t u8SD)
    4949{
     50    int rc;
    5051    RT_NOREF(pThis);
    5152    AssertPtrReturn(pStream, VERR_INVALID_POINTER);
     
    6263#endif
    6364
    64     int rc = RTCritSectInit(&pStream->CritSect);
     65# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
     66    rc = RTCritSectInit(&pStream->CritSect);
    6567    AssertRCReturn(rc, rc);
     68# endif
    6669
    6770    rc = hdaR3StreamPeriodCreate(&pStream->State.Period);
     
    146149#endif
    147150
     151# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
    148152    if (RTCritSectIsInitialized(&pStream->CritSect))
    149153    {
     
    151155        AssertRC(rc2);
    152156    }
     157# endif
    153158
    154159    if (pStream->State.pCircBuf)
     
    15891594{
    15901595    AssertPtrReturnVoid(pStream);
     1596# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
    15911597    int rc2 = RTCritSectEnter(&pStream->CritSect);
    15921598    AssertRC(rc2);
     1599# else
     1600    Assert(PDMDevHlpCritSectIsOwner(pStream->pHDAState->pDevInsR3, pStream->pHDAState->CritSect));
     1601# endif
    15931602}
    15941603
     
    16021611{
    16031612    AssertPtrReturnVoid(pStream);
     1613# ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
    16041614    int rc2 = RTCritSectLeave(&pStream->CritSect);
    16051615    AssertRC(rc2);
     1616# endif
    16061617}
    16071618
  • trunk/src/VBox/Devices/Audio/HDAStream.h

    r82417 r82420  
    238238    /** The timer for pumping data thru the attached LUN drivers. */
    239239    TMTIMERHANDLE               hTimer;
    240     /** The stream'S critical section to serialize access. */
     240#ifdef VBOX_WITH_AUDIO_HDA_ASYNC_IO
     241    /** The stream's critical section to serialize access between the async I/O
     242     *  thread and (basically) the guest. */
    241243    RTCRITSECT                  CritSect;
     244#endif
    242245    /** Internal state of this stream. */
    243246    HDASTREAMSTATE              State;
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