VirtualBox

Ignore:
Timestamp:
Jul 13, 2009 2:49:39 PM (15 years ago)
Author:
vboxsync
Message:

iprt/thread.h: Redefined RTThreadPreemptIsEnabled for systems without preemption (we keep count ourselves). Added RTThreadPreemptIsPossible and RTThreadIsInInterrupt. Fixed RTThreadPreemptIsEnabled on FreeBSD and Solaris/vbi.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/freebsd/thread-r0drv-freebsd.c

    r20554 r21536  
    3535
    3636#include <iprt/thread.h>
     37#include <iprt/asm.h>
     38#include <iprt/assert.h>
    3739#include <iprt/err.h>
    38 #include <iprt/assert.h>
    3940
    4041#include "internal/thread.h"
     
    112113    Assert(hThread == NIL_RTTHREAD);
    113114
    114     return curthread->td_critnest == 0;
     115    return curthread->td_critnest == 0
     116        && ASMIntAreEnabled(); /** @todo is there a native freebsd function/macro for this? */
    115117}
    116118
     
    127129{
    128130    /* yes, RTThreadPreemptIsPending is reliable. */
     131    return true;
     132}
     133
     134
     135RTDECL(bool) RTThreadPreemptIsPossible(void)
     136{
     137    /* yes, kernel preemption is possible. */
    129138    return true;
    130139}
     
    150159}
    151160
     161
     162RTDECL(bool) RTThreadIsInInterrupt(RTTHREAD hThread)
     163{
     164    Assert(hThread == NIL_RTTHREAD); NOREF(hThread);
     165    /** @todo FreeBSD: Implement RTThreadIsInInterrupt. Required for guest
     166     *        additions! */
     167    return !ASMIntAreEnabled();
     168}
     169
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