VirtualBox

Changeset 13262 in vbox


Ignore:
Timestamp:
Oct 14, 2008 1:09:04 PM (16 years ago)
Author:
vboxsync
Message:

iprt: RTThreadPreemptIsEanbled - check the interrupt flags too.

Location:
trunk/src/VBox/Runtime/r0drv
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/nt/thread-r0drv-nt.cpp

    r13254 r13262  
    3636#include <iprt/thread.h>
    3737#include <iprt/err.h>
     38#include <iprt/assert.h>
     39#include <iprt/asm.h>
    3840
    3941__BEGIN_DECLS
     
    7678    Assert(hThread == NIL_RTTHREAD);
    7779    KIRQL Irql = KeGetCurrentIrql();
    78     return Irql <= APC_LEVEL;
     80    if (Irql > APC_LEVEL)
     81        return false;
     82#if defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64)
     83    if (!(ASMGetFlags() & 0x00000200 /* X86_EFL_IF */))
     84        return false;
     85#endif
     86    return true;
    7987}
    8088
  • trunk/src/VBox/Runtime/r0drv/solaris/thread-r0drv-solaris.c

    r13254 r13262  
    3636#include <iprt/thread.h>
    3737#include <iprt/err.h>
     38#include <iprt/asm.h>
    3839#include <iprt/assert.h>
    3940
     
    102103{
    103104    Assert(hThread == NIL_RTTHREAD);
    104     return curthread->t_preempt == 0;
     105    if (curthread->t_preempt != 0)
     106        return false;
     107#if defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64)
     108    if (!(ASMGetFlags() & 0x00000200 /* X86_EFL_IF */))
     109        return false;
     110#endif
     111    return true;
    105112}
    106113
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