VirtualBox

Ignore:
Timestamp:
Jul 13, 2009 2:49:39 PM (16 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/solaris/vbi/thread-r0drv-solaris.c

    r21452 r21536  
    2929 */
    3030
     31
    3132/*******************************************************************************
    3233*   Header Files                                                               *
     
    3536
    3637#include <iprt/thread.h>
     38#include <iprt/asm.h>
     39#include <iprt/assert.h>
    3740#include <iprt/err.h>
    38 #include <iprt/assert.h>
     41
    3942
    4043RTDECL(RTNATIVETHREAD) RTThreadNativeSelf(void)
     
    100103{
    101104    Assert(hThread == NIL_RTTHREAD);
    102     return vbi_is_preempt_enabled() != 0;
     105    if (    vbi_is_preempt_enabled()
     106        &&  ASMIntAreEnabled())
     107        return true;
     108    return false;
    103109}
    104110
     
    107113{
    108114    Assert(hThread == NIL_RTTHREAD);
    109     /** @todo Review this! */
    110115    return !!vbi_is_preempt_pending();
    111116}
     
    115120{
    116121    /* yes, RTThreadPreemptIsPending is reliable. */
     122    return true;
     123}
     124
     125
     126RTDECL(bool) RTThreadPreemptIsPossible(void)
     127{
     128    /* yes, kernel preemption is possible. */
    117129    return true;
    118130}
     
    136148}
    137149
     150
     151RTDECL(bool) RTThreadIsInInterrupt(RTTHREAD hThread)
     152{
     153    Assert(hThread == NIL_RTTHREAD); NOREF(hThread);
     154    /** @todo Solaris: Implement RTThreadIsInInterrupt. Required for guest
     155     *        additions! */
     156    return !ASMIntAreEnabled();
     157}
     158
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