VirtualBox

Ignore:
Timestamp:
Oct 14, 2008 12:35:50 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
37865
Message:

IPRT: Added RTThreadPreemptIsEnabled, RTThreadPreemptDisable and RTThreadPreemptRestore. Made the logger check that preemption is enabled before trying to take the semaphore on Solaris and Windows.

File:
1 edited

Legend:

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

    r9176 r13254  
    6262#if 0
    6363    timeout = ddi_get_lbolt();
    64     timeout += cTicks; 
    65  
     64    timeout += cTicks;
     65
    6666    kcondvar_t cnd;
    6767    kmutex_t mtx;
     
    9696}
    9797
     98
     99RTDECL(bool) RTThreadPreemptIsEnabled(RTTHREAD hThread)
     100{
     101    Assert(hThread == NIL_RTTHREAD);
     102    return vbi_is_preempt_enabled() != 0;
     103}
     104
     105
     106RTDECL(void) RTThreadPreemptDisable(PRTTHREADPREEMPTSTATE pState)
     107{
     108    AssertPtr(pState);
     109    Assert(pState->uchDummy != 42);
     110    pState->uchDummy = 42;
     111    vbi_preempt_disable();
     112}
     113
     114
     115RTDECL(void) RTThreadPreemptRestore(PRTTHREADPREEMPTSTATE pState)
     116{
     117    AssertPtr(pState);
     118    Assert(pState->uchDummy == 42);
     119    pState->uchDummy = 0;
     120    vbi_preempt_enable();
     121}
     122
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette