VirtualBox

Ignore:
Timestamp:
Mar 31, 2015 10:29:00 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
99347
Message:

VBoxUSB: fixed BSOD on host computer at system waking up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/src/VBox/HostDrivers/VBoxUSB/win/cmn/VBoxDrvTool.cpp

    r38356 r55058  
    188188    Interval.QuadPart = -(int64_t) 2 /* ms */ * 10000;
    189189    uint32_t cRefs;
    190 
    191     while ((cRefs = ASMAtomicReadU32(&pRef->cRefs)) != u32Val)
     190    size_t loops = 0;
     191    KTIMER kTimer;
     192    NTSTATUS status = STATUS_SUCCESS;
     193
     194    KeInitializeTimer(&kTimer);
     195   
     196    while ((cRefs = ASMAtomicReadU32(&pRef->cRefs)) > u32Val && loops < 256)
    192197    {
    193198        Assert(cRefs >= u32Val);
    194199        Assert(cRefs < UINT32_MAX/2);
    195200
    196         KeDelayExecutionThread(KernelMode, FALSE, &Interval);
     201        KeSetTimer(&kTimer, Interval, NULL);
     202        status = KeWaitForSingleObject(&kTimer, Executive, KernelMode, false, NULL);
     203        Assert(NT_SUCCESS(status));
     204        loops++;
    197205    }
    198206}
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