VirtualBox

Changeset 7839 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 9, 2008 2:02:14 PM (17 years ago)
Author:
vboxsync
Message:

Poke waiting thread on suspend and power off to make PDM happy.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r7831 r7839  
    42654265}
    42664266
     4267
    42674268/**
    42684269 *
     
    42974298    return rc;
    42984299}
     4300
    42994301
    43004302/**
     
    44294431    }
    44304432    return VERR_PDM_LUN_NOT_FOUND;
     4433}
     4434
     4435
     4436/**
     4437 * @copydoc FNPDMDEVPOWEROFF
     4438 */
     4439static DECLCALLBACK(void) pcnetPowerOff(PPDMDEVINS pDevIns)
     4440{
     4441    PCNetState *pData = PDMINS_2_DATA(pDevIns, PCNetState *);
     4442
     4443    /* Poke thread waiting for buffer space. */
     4444    if (    pData->fMaybeOutOfSpace
     4445        &&  pData->hEventOutOfRxSpace != NIL_RTSEMEVENT)
     4446        RTSemEventSignal(pData->hEventOutOfRxSpace);
     4447}
     4448
     4449
     4450/**
     4451 * @copydoc FNPDMDEVSUSPEND
     4452 */
     4453static DECLCALLBACK(void) pcnetSuspend(PPDMDEVINS pDevIns)
     4454{
     4455    PCNetState *pData = PDMINS_2_DATA(pDevIns, PCNetState *);
     4456
     4457    /* Poke thread waiting for buffer space. */
     4458    if (    pData->fMaybeOutOfSpace
     4459        &&  pData->hEventOutOfRxSpace != NIL_RTSEMEVENT)
     4460        RTSemEventSignal(pData->hEventOutOfRxSpace);
    44314461}
    44324462
     
    49404970    pcnetReset,
    49414971    /* pfnSuspend */
    4942     NULL,
     4972    pcnetSuspend,
    49434973    /* pfnResume */
    49444974    NULL,
     
    49484978    NULL,
    49494979    /* pfnQueryInterface. */
    4950     NULL
     4980    NULL,
     4981    /* pfnInitComplete. */
     4982    NULL,
     4983    /* pfnPowerOff. */
     4984    pcnetPowerOff
    49514985};
    49524986
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