VirtualBox

Changeset 31352 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Aug 4, 2010 9:45:01 AM (15 years ago)
Author:
vboxsync
Message:

Don't assume a thread can't migrate to another CPU. The code that requires this must (and already does) disable preemption.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/VMMAll.cpp

    r30329 r31352  
    6060        return 0;
    6161
    62     /* RTMpCpuId had better be cheap. */
    63     RTCPUID idHostCpu = RTMpCpuId();
     62    /* RTThreadGetNativeSelf had better be cheap. */
     63    RTNATIVETHREAD hThread = RTThreadNativeSelf();
    6464
    6565    /** @todo optimize for large number of VCPUs when that becomes more common. */
     
    6868        PVMCPU pVCpu = &pVM->aCpus[idCpu];
    6969
    70         if (pVCpu->idHostCpu == idHostCpu)
     70        if (pVCpu->hNativeThread == hThread)
    7171            return pVCpu->idCpu;
    7272    }
     
    9999        return &pVM->aCpus[0];
    100100
    101     /* RTMpCpuId had better be cheap. */
    102     RTCPUID idHostCpu = RTMpCpuId();
     101    /* RTThreadGetNativeSelf had better be cheap. */
     102    RTNATIVETHREAD hThread = RTThreadNativeSelf();
    103103
    104104    /** @todo optimize for large number of VCPUs when that becomes more common. */
     
    107107        PVMCPU pVCpu = &pVM->aCpus[idCpu];
    108108
    109         if (pVCpu->idHostCpu == idHostCpu)
     109        if (pVCpu->hNativeThread == hThread)
    110110            return pVCpu;
    111111    }
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