VirtualBox

Changeset 24179 in vbox for trunk/src/VBox/Runtime/r0drv


Ignore:
Timestamp:
Oct 30, 2009 10:26:43 AM (15 years ago)
Author:
vboxsync
Message:

iprt/initterm.h,SUPDrv-solaris.c: Added RTR0TermForced so the module containing IPRT can make sure it's really terminated and that modules not calling RTR0Term doesn't create trouble (other than debug assertions). Use this for SUPDrv on Solaris.

File:
1 edited

Legend:

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

    r22052 r24179  
    8383    if (RT_SUCCESS(rc))
    8484    {
    85 #if !defined(RT_OS_LINUX)
     85#if !defined(RT_OS_LINUX) /** @todo implement thread2-r0drv-linux.c */
    8686        rc = rtThreadInit();
    8787#endif
     
    9191            rc = rtR0MpNotificationInit();
    9292            if (RT_SUCCESS(rc))
     93            {
    9394                rc = rtR0PowerNotificationInit();
    94 #endif
     95                if (RT_SUCCESS(rc))
     96                    return rc;
     97                rtR0MpNotificationTerm();
     98            }
     99#else
    95100            if (RT_SUCCESS(rc))
    96101                return rc;
     102#endif
     103#if !defined(RT_OS_LINUX) /** @todo implement thread2-r0drv-linux.c */
     104            rtThreadTerm();
     105#endif
    97106        }
    98 
    99107        rtR0TermNative();
    100108    }
     
    102110}
    103111RT_EXPORT_SYMBOL(RTR0Init);
     112
     113
     114static void rtR0Term(void)
     115{
     116#if !defined(RT_OS_LINUX) /** @todo implement thread2-r0drv-linux.c */
     117    rtThreadTerm();
     118#endif
     119#ifndef IN_GUEST /* play safe for now */
     120    rtR0PowerNotificationTerm();
     121    rtR0MpNotificationTerm();
     122#endif
     123    rtR0TermNative();
     124}
    104125
    105126
     
    112133    RT_ASSERT_PREEMPTIBLE();
    113134
    114     /*
    115      * Last user does the cleanup.
    116      */
    117135    cNewUsers = ASMAtomicDecS32(&g_crtR0Users);
    118136    Assert(cNewUsers >= 0);
    119     if (cNewUsers != 0)
    120         return;
    121 
    122 #if !defined(RT_OS_LINUX)
    123     rtThreadTerm();
    124 #endif
    125 #ifndef IN_GUEST /* play safe for now */
    126     rtR0PowerNotificationTerm();
    127     rtR0MpNotificationTerm();
    128 #endif
    129     rtR0TermNative();
     137    if (cNewUsers == 0)
     138        rtR0Term();
    130139}
    131140RT_EXPORT_SYMBOL(RTR0Term);
    132141
     142
     143/* Note! Should *not* be exported since it's only for static linking. */
     144RTR0DECL(void) RTR0TermForced(void)
     145{
     146    RT_ASSERT_PREEMPTIBLE();
     147    AssertMsg(g_crtR0Users == 1, ("%d\n", g_crtR0Users));
     148
     149    rtR0Term();
     150}
     151
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