VirtualBox

Changeset 3051 in kBuild for trunk/src/kmk/w32/subproc


Ignore:
Timestamp:
Jul 24, 2017 10:59:59 AM (8 years ago)
Author:
bird
Message:

kmk,kWorker: More aggressive handling of --nice (and --priority) on windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/w32/subproc/sub_proc.c

    r2912 r3051  
    548548#ifdef KMK
    549549        size_t exec_path_len;
     550        extern int process_priority;
    550551
    551552        assert (pproc->enmType == kRegular);
     
    716717                else if (argv[0])
    717718                        kmk_cache_exec_image(argv[0]);
     719
     720                switch (process_priority) {
     721                case 1: flags |= CREATE_SUSPENDED | IDLE_PRIORITY_CLASS; break;
     722                case 2: flags |= CREATE_SUSPENDED | BELOW_NORMAL_PRIORITY_CLASS; break;
     723                case 3: flags |= CREATE_SUSPENDED | NORMAL_PRIORITY_CLASS; break;
     724                case 4: flags |= CREATE_SUSPENDED | HIGH_PRIORITY_CLASS; break;
     725                case 5: flags |= CREATE_SUSPENDED | REALTIME_PRIORITY_CLASS; break;
     726                }
    718727#endif
    719728                if (CreateProcess(
     
    741750                        return(-1);
    742751                }
     752#ifdef KMK
     753                switch (process_priority) {
     754                case 1: SetThreadPriority(procInfo.hThread, THREAD_PRIORITY_IDLE); break;
     755                case 2: SetThreadPriority(procInfo.hThread, THREAD_PRIORITY_BELOW_NORMAL); break;
     756                case 3: SetThreadPriority(procInfo.hThread, THREAD_PRIORITY_NORMAL); break;
     757                case 4: SetThreadPriority(procInfo.hThread, THREAD_PRIORITY_HIGHEST); break;
     758                case 5: SetThreadPriority(procInfo.hThread, THREAD_PRIORITY_TIME_CRITICAL); break;
     759                }
     760                ResumeThread(procInfo.hThread);
     761#endif
    743762        }
    744763
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