VirtualBox

Changeset 49817 in vbox for trunk/src


Ignore:
Timestamp:
Dec 6, 2013 9:54:10 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
91159
Message:

Fix darwin burn

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/USB/darwin/USBProxyDevice-darwin.cpp

    r49814 r49817  
    241241    /** The tail of the landed Darwin URBs. */
    242242    PUSBPROXYURBOSX         pTaxingTail;
     243    /** Runloop reference of the thread reaping. */
     244    volatile CFRunLoopRef   hRunLoopReaping;
     245    /** Flag whether the reaping thread is about the be waked. */
     246    volatile bool           fReapingThreadWake;
    243247} USBPROXYDEVOSX, *PUSBPROXYDEVOSX;
    244248
     
    17901794    PUSBPROXYDEVOSX pDevOsX = (PUSBPROXYDEVOSX)pProxyDev->Backend.pv;
    17911795
     1796    ASMAtomicXchgPtr((void * volatile *)&pDevOsX->hRunLoopReaping, CFRunLoopGetCurrent());
     1797
     1798    if (ASMAtomicReadBool(&pDevOsX->fReapingThreadWake))
     1799    {
     1800        /* Return immediately. */
     1801        ASMAtomicXchgPtr((void * volatile *)&pDevOsX->hRunLoopReaping, NULL);
     1802        return NULL;
     1803    }
     1804
    17921805    /*
    17931806     * If we've got any in-flight URBs, excercise the runloop.
     
    18001813        &&  pDevOsX->pInFlightHead)
    18011814        CFRunLoopRunInMode(g_pRunLoopMode, cMillies / 1000.0, true);
     1815
     1816    ASMAtomicXchgPtr((void * volatile *)&pDevOsX->hRunLoopReaping, NULL);
    18021817
    18031818    /*
     
    18721887
    18731888
    1874 static int usbProxyDarwinUrbReap(PUSBPROXYDEV pProxyDev, RTMSINTERVAL cMillies)
     1889static int usbProxyDarwinWakeup(PUSBPROXYDEV pProxyDev)
    18751890{
    18761891    PUSBPROXYDEVOSX pDevOsX = (PUSBPROXYDEVOSX)pProxyDev->Backend.pv;
    18771892
    1878     CFRunLoopStop(g_pRunLoopMode);
     1893    ASMAtomicXchgBool(&pDevOsX->fReapingThreadWake, true);
     1894
     1895    CFRunLoopRef hRunLoopWake = (CFRunLoopRef)ASMAtomicReadPtr((void * volatile *)&pDevOsX->hRunLoopReaping);
     1896    if (hRunLoopWake)
     1897        CFRunLoopStop(hRunLoopWake);
     1898
     1899    ASMAtomicXchgBool(&pDevOsX->fReapingThreadWake, false);
     1900
    18791901    return VINF_SUCCESS;
    18801902}
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