VirtualBox

Changeset 22439 in vbox


Ignore:
Timestamp:
Aug 25, 2009 2:42:08 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
51435
Message:

vbi/mpnotification-r0drv-solaris.c: Removed the racy code.

File:
1 edited

Legend:

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

    r22366 r22439  
    4444*   Global Variables                                                           *
    4545*******************************************************************************/
     46/** CPU watch callback handle. */
    4647static vbi_cpu_watch_t *g_hVbiCpuWatch = NULL;
     48/** Set of online cpus that is maintained by the MP callback.
     49 * This avoids locking issues quering the set from the kernel as well as
     50 * eliminating any uncertainty regarding the online status during the
     51 * callback. */
     52RTCPUSET g_rtMpSolarisCpuSet;
    4753
    48 RTCPUSET g_rtMpSolarisCpuSet;
    4954
    5055static void rtMpNotificationSolarisCallback(void *pvUser, int iCpu, int online)
     
    7479
    7580    /*
    76      * Cache the list of online CPUs.
     81     * Register the callback building the online cpu set as we
     82     * do so (current_too = 1).
    7783     */
    7884    RTCpuSetEmpty(&g_rtMpSolarisCpuSet);
    79 
    80     g_hVbiCpuWatch = vbi_watch_cpus(rtMpNotificationSolarisCallback, NULL, 1 /* watch current CPU too */);
    81 
    82     RTCPUID idCpu = RTMpGetMaxCpuId();
    83     do
    84     {
    85         /** @todo vbi_cpu_online() should boundary check "idCpu" rather than hang the system. */
    86         if (   RTMpIsCpuPossible(idCpu)
    87             && vbi_cpu_online(idCpu))
    88         {
    89             RTCpuSetAdd(&g_rtMpSolarisCpuSet, idCpu);
    90         }
    91     } while (idCpu-- > 0);
     85    g_hVbiCpuWatch = vbi_watch_cpus(rtMpNotificationSolarisCallback, NULL, 1 /*current_too*/);
    9286
    9387    return VINF_SUCCESS;
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