VirtualBox

Changeset 40806 in vbox for trunk/src/VBox/VMM/VMMR3


Ignore:
Timestamp:
Apr 6, 2012 9:05:19 PM (13 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
77321
Message:

RTSpinlock: Redid the interface, eliminating NoInts and Tmp. Whether a spinlock is interrupt safe or not is now defined at creation time, preventing stupid bugs arrising from calling the wrong acquire and/or release methods somewhere. The saved flags are stored in the spinlock strucutre, eliminating the annoying Tmp variable. Needs testing on each platform before fixing the build burn.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PDMBlkCache.cpp

    r39515 r40806  
    657657    /* The list is moved to a new header to reduce locking overhead. */
    658658    RTLISTANCHOR ListDirtyNotCommitted;
    659     RTSPINLOCKTMP Tmp;
    660659
    661660    RTListInit(&ListDirtyNotCommitted);
    662     RTSpinlockAcquire(pBlkCache->LockList, &Tmp);
     661    RTSpinlockAcquire(pBlkCache->LockList);
    663662    RTListMove(&ListDirtyNotCommitted, &pBlkCache->ListDirtyNotCommitted);
    664     RTSpinlockRelease(pBlkCache->LockList, &Tmp);
     663    RTSpinlockRelease(pBlkCache->LockList);
    665664
    666665    if (!RTListIsEmpty(&ListDirtyNotCommitted))
     
    755754        pEntry->fFlags |= PDMBLKCACHE_ENTRY_IS_DIRTY;
    756755
    757         RTSPINLOCKTMP Tmp;
    758         RTSpinlockAcquire(pBlkCache->LockList, &Tmp);
     756        RTSpinlockAcquire(pBlkCache->LockList);
    759757        RTListAppend(&pBlkCache->ListDirtyNotCommitted, &pEntry->NodeNotCommitted);
    760         RTSpinlockRelease(pBlkCache->LockList, &Tmp);
     758        RTSpinlockRelease(pBlkCache->LockList);
    761759
    762760        uint32_t cbDirty = ASMAtomicAddU32(&pCache->cbDirty, pEntry->cbData);
     
    12201218            RTListInit(&pBlkCache->ListDirtyNotCommitted);
    12211219
    1222             rc = RTSpinlockCreate(&pBlkCache->LockList);
     1220            rc = RTSpinlockCreate(&pBlkCache->LockList, RTSPINLOCK_FLAGS_INTERRUPT_UNSAFE, "pdmR3BlkCacheRetain");
    12231221            if (RT_SUCCESS(rc))
    12241222            {
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