VirtualBox

Changeset 38144 in vbox for trunk


Ignore:
Timestamp:
Jul 25, 2011 11:01:10 AM (13 years ago)
Author:
vboxsync
Message:

wddm: fix deadlock

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPMisc.cpp

    r38112 r38144  
    375375{
    376376    VBOXWDDM_HTABLE_ITERATOR Iter;
    377     ExAcquireFastMutex(&pDevExt->ContextMutex);
    378     vboxWddmHTableIterInit(&pContext->Swapchains, &Iter);
     377    bool fRestart = false;
    379378    do
    380379    {
    381         PVBOXWDDM_SWAPCHAIN pSwapchain = (PVBOXWDDM_SWAPCHAIN)vboxWddmHTableIterNext(&Iter, NULL);
    382         if (!pSwapchain)
    383             break;
    384 
    385         /* yes, we can call remove locked even when using iterator */
    386         vboxWddmSwapchainCtxRemoveLocked(pDevExt, pContext, pSwapchain);
    387 //        vboxWddmHTableIterRemoveCur(&Iter);
    388 
    389         vboxWddmSwapchainDestroy(pDevExt, pSwapchain);
    390     } while (1);
     380        ExAcquireFastMutex(&pDevExt->ContextMutex);
     381        vboxWddmHTableIterInit(&pContext->Swapchains, &Iter);
     382        do
     383        {
     384            PVBOXWDDM_SWAPCHAIN pSwapchain = (PVBOXWDDM_SWAPCHAIN)vboxWddmHTableIterNext(&Iter, NULL);
     385            if (!pSwapchain)
     386                break;
     387
     388            /* yes, we can call remove locked even when using iterator */
     389            vboxWddmSwapchainCtxRemoveLocked(pDevExt, pContext, pSwapchain);
     390    //        vboxWddmHTableIterRemoveCur(&Iter);
     391
     392            ExReleaseFastMutex(&pDevExt->ContextMutex);
     393            /* we must not do vboxWddmSwapchainDestroy inside a context mutex */
     394            vboxWddmSwapchainDestroy(pDevExt, pSwapchain);
     395            fRestart = true;
     396        } while (1);
     397    } while (fRestart);
    391398    ExReleaseFastMutex(&pDevExt->ContextMutex);
    392399}
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