VirtualBox

Changeset 22129 in vbox


Ignore:
Timestamp:
Aug 10, 2009 12:12:17 PM (15 years ago)
Author:
vboxsync
Message:

spinlock-r0drv-solaris.c: More preemption assertions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/solaris/spinlock-r0drv-solaris.c

    r22126 r22129  
    4141#include <iprt/err.h>
    4242#include <iprt/mem.h>
     43#include <iprt/mp.h>
    4344#include <iprt/thread.h>
    4445#include "internal/magics.h"
     
    112113
    113114    pTmp->uFlags = ASMIntDisableFlags();
    114     mutex_enter(&pSpinlockInt->Mtx);
     115    {
     116        RT_ASSERT_PREEMPT_CPUID_VAR();
     117        mutex_enter(&pSpinlockInt->Mtx);
     118        RT_ASSERT_PREEMPT_CPUID();
     119    }
    115120}
    116121
     
    130135{
    131136    PRTSPINLOCKINTERNAL pSpinlockInt = (PRTSPINLOCKINTERNAL)Spinlock;
     137    RT_ASSERT_PREEMPT_CPUID_VAR();
    132138    AssertPtr(pSpinlockInt);
    133139    Assert(pSpinlockInt->u32Magic == RTSPINLOCK_MAGIC);
     
    135141
    136142    mutex_enter(&pSpinlockInt->Mtx);
     143    RT_ASSERT_PREEMPT_CPUID();
     144#ifdef RT_MORE_STRICT
     145    /* Spinlocks are not preemptible, so we cannot be rescheduled. */
     146    pTmp->uFlags = idAssertCpu != NIL_RTCPUID ? idAssertCpu : RTMpCpuId();
     147#endif
    137148}
    138149
     
    141152{
    142153    PRTSPINLOCKINTERNAL pSpinlockInt = (PRTSPINLOCKINTERNAL)Spinlock;
     154#ifdef RT_MORE_STRICT
     155    RTCPUID const idAssertCpu = pTmp->uFlags;
     156    pTmp->uFlags = 0;
     157#endif
    143158    AssertPtr(pSpinlockInt);
    144159    Assert(pSpinlockInt->u32Magic == RTSPINLOCK_MAGIC);
     160    RT_ASSERT_PREEMPT_CPUID();
    145161    NOREF(pTmp);
    146162
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