VirtualBox

Changeset 37154 in vbox for trunk/src/VBox/Runtime/r3/win


Ignore:
Timestamp:
May 19, 2011 12:54:32 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
71834
Message:

RTThread[SG]etAffinity cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/win/thread-win.cpp

    r36555 r37154  
    281281
    282282
    283 RTR3DECL(int) RTThreadSetAffinity(uint64_t u64Mask)
    284 {
    285     Assert((DWORD_PTR)u64Mask == u64Mask || u64Mask == ~(uint64_t)0);
    286     DWORD_PTR dwRet = SetThreadAffinityMask(GetCurrentThread(), (DWORD_PTR)u64Mask);
     283RTR3DECL(int) RTThreadSetAffinity(PCRTCPUSET pCpuSet)
     284{
     285    DWORD_PTR fNewMask = pCpuSet ? RTCpuSetToU64(pCpuSet) : ~(DWORD_PTR)0;
     286    DWORD_PTR dwRet = SetThreadAffinityMask(GetCurrentThread(), fNewMask);
    287287    if (dwRet)
    288288        return VINF_SUCCESS;
     
    294294
    295295
    296 RTR3DECL(uint64_t) RTThreadGetAffinity(void)
     296RTR3DECL(int) RTThreadGetAffinity(PRTCPUSET pCpuSet)
    297297{
    298298    /*
     
    309309            DWORD_PTR dwSet = SetThreadAffinityMask(hThread, dwRet);
    310310            Assert(dwSet == dwProcAff); NOREF(dwRet);
    311             return dwRet;
     311
     312            RTCpuSetFromU64(pCpuSet, (uint64_t)dwSet);
     313            return VINF_SUCCESS;
    312314        }
    313315    }
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