VirtualBox

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


Ignore:
Timestamp:
Apr 12, 2007 4:00:24 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
20356
Message:

Make named pipe destruction independent of driver destruction order.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Serial/DrvNamedPipe.cpp

    r1803 r2052  
    553553    LogFlow(("%s: %s\n", __FUNCTION__, pData->pszLocation));
    554554
     555    if (pData->ListenThread)
     556    {
     557        RTThreadWait(pData->ListenThread, 250, NULL);
     558        if (pData->ListenThread != NIL_RTTHREAD)
     559            LogRel(("NamedPipe%d: listen thread did not terminate\n", pDrvIns->iInstance));
     560    }
     561
     562    if (pData->pszLocation)
     563        MMR3HeapFree(pData->pszLocation);
     564}
     565
     566
     567/**
     568 * Power off a named pipe stream driver instance.
     569 *
     570 * This does most of the destruction work, to avoid ordering dependencies.
     571 *
     572 * @param   pDrvIns     The driver instance data.
     573 */
     574static DECLCALLBACK(void) drvNamedPipePowerOff(PPDMDRVINS pDrvIns)
     575{
     576    PDRVNAMEDPIPE pData = PDMINS2DATA(pDrvIns, PDRVNAMEDPIPE);
     577    LogFlow(("%s: %s\n", __FUNCTION__, pData->pszLocation));
     578
    555579    pData->fShutdown = true;
    556580
     
    584608    }
    585609#endif /* !__WIN__ */
    586 
    587     if (pData->ListenThread)
    588     {
    589         RTThreadWait(pData->ListenThread, 250, NULL);
    590         if (pData->ListenThread != NIL_RTTHREAD)
    591             LogRel(("NamedPipe%d: listen thread did not terminate\n", pDrvIns->iInstance));
    592     }
    593 
    594     if (pData->pszLocation)
    595         MMR3HeapFree(pData->pszLocation);
    596610}
    597611
     
    633647    NULL,
    634648    /* pfnPowerOff */
    635     NULL
     649    drvNamedPipePowerOff,
    636650};
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