VirtualBox

Changeset 76634 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Jan 4, 2019 1:55:24 PM (6 years ago)
Author:
vboxsync
Message:

IPRT/rtProcNativeSetPriority: Must update g_pProcessPriority on windows and OS/2.

Location:
trunk/src/VBox/Runtime/r3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/os2/sched-os2.cpp

    r76553 r76634  
    209209{
    210210    Assert(enmPriority > RTPROCPRIORITY_INVALID && enmPriority < RTPROCPRIORITY_LAST);
    211     return VINF_SUCCESS;
     211
     212    if (enmPriority == RTPROCPRIORITY_DEFAULT)
     213    {
     214        g_pProcessPriority = &g_aDefaultPriority;
     215        return VINF_SUCCESS;
     216    }
     217
     218    for (size_t i = 0; i < RT_ELEMENTS(g_aPriorities); i++)
     219        if (g_aPriorities[i].enmPriority == enmPriority)
     220        {
     221            g_pProcessPriority = &g_aPriorities[i];
     222            return VINF_SUCCESS;
     223        }
     224
     225    AssertFailedReturn(VERR_INTERNAL_ERROR);
    212226}
    213227
  • trunk/src/VBox/Runtime/r3/win/sched-win.cpp

    r76553 r76634  
    276276{
    277277    Assert(enmPriority > RTPROCPRIORITY_INVALID && enmPriority < RTPROCPRIORITY_LAST); RT_NOREF_PV(enmPriority);
    278     return VINF_SUCCESS;
     278
     279    if (enmPriority == RTPROCPRIORITY_DEFAULT)
     280    {
     281        g_pProcessPriority = &g_aDefaultPriority;
     282        return VINF_SUCCESS;
     283    }
     284
     285    for (size_t i = 0; i < RT_ELEMENTS(g_aPriorities); i++)
     286        if (   g_aPriorities[i].enmPriority == enmPriority
     287            && g_aPriorities[i].dwProcessPriorityClass == ANY_PROCESS_PRIORITY_CLASS)
     288        {
     289            g_pProcessPriority = &g_aPriorities[i];
     290            return VINF_SUCCESS;
     291        }
     292
     293    AssertFailedReturn(VERR_INTERNAL_ERROR);
    279294}
    280295
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