VirtualBox

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


Ignore:
Timestamp:
Apr 6, 2012 9:05:19 PM (13 years ago)
Author:
vboxsync
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/VMMRZ/PGMRZDynMap.cpp

    r39745 r40806  
    8888 */
    8989# define PGMRZDYNMAP_SPINLOCK_ACQUIRE(pThis) \
    90     RTSPINLOCKTMP   MySpinlockTmp = RTSPINLOCKTMP_INITIALIZER; \
    91     RTSpinlockAcquire((pThis)->hSpinlock, &MySpinlockTmp)
     90    RTSpinlockAcquire((pThis)->hSpinlock)
     91
    9292/**
    9393 * Releases the spinlock.
    9494 */
    9595# define PGMRZDYNMAP_SPINLOCK_RELEASE(pThis) \
    96     RTSpinlockRelease((pThis)->hSpinlock, &MySpinlockTmp)
     96    RTSpinlockRelease((pThis)->hSpinlock)
    9797
    9898/**
     
    100100 */
    101101# define PGMRZDYNMAP_SPINLOCK_REACQUIRE(pThis) \
    102     RTSpinlockAcquire((pThis)->hSpinlock, &MySpinlockTmp)
     102    RTSpinlockAcquire((pThis)->hSpinlock)
    103103#else
    104104# define PGMRZDYNMAP_SPINLOCK_ACQUIRE(pThis)   do { } while (0)
     
    408408        if (RT_SUCCESS(rc))
    409409        {
    410             rc = RTSpinlockCreate(&pThis->hSpinlock);
     410            rc = RTSpinlockCreate(&pThis->hSpinlock, RTSPINLOCK_FLAGS_INTERRUPT_UNSAFE, "PGMR0DynMap");
    411411            if (RT_SUCCESS(rc))
    412412            {
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