Changeset 3051 for trunk/src/kmk/main.c
- Timestamp:
- Jul 24, 2017, 12:59:59 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/main.c
r3041 r3051 863 863 { 864 864 # ifdef WINDOWS32 865 DWORD dwPriority; 865 DWORD dwClass, dwPriority; 866 866 867 if (process_affinity) 867 868 if (!SetProcessAffinityMask (GetCurrentProcess (), process_affinity)) 868 fprintf (stderr, "warning: SetPr iorityClass(,%#x) failed with last error %d\n",869 fprintf (stderr, "warning: SetProcessAffinityMask (,%#x) failed with last error %d\n", 869 870 process_affinity, GetLastError ()); 870 871 … … 872 873 { 873 874 case 0: return; 874 case 1: dw Priority = IDLE_PRIORITY_CLASS; break;875 case 2: dw Priority = BELOW_NORMAL_PRIORITY_CLASS; break;876 case 3: dw Priority = NORMAL_PRIORITY_CLASS; break;877 case 4: dw Priority = HIGH_PRIORITY_CLASS; break;878 case 5: dw Priority = REALTIME_PRIORITY_CLASS; break;875 case 1: dwClass = IDLE_PRIORITY_CLASS; dwPriority = THREAD_PRIORITY_IDLE; break; 876 case 2: dwClass = BELOW_NORMAL_PRIORITY_CLASS; dwPriority = THREAD_PRIORITY_BELOW_NORMAL; break; 877 case 3: dwClass = NORMAL_PRIORITY_CLASS; dwPriority = THREAD_PRIORITY_NORMAL; break; 878 case 4: dwClass = HIGH_PRIORITY_CLASS; dwPriority = 0xffffffff; break; 879 case 5: dwClass = REALTIME_PRIORITY_CLASS; dwPriority = 0xffffffff; break; 879 880 default: fatal (NILF, _("invalid priority %d\n"), process_priority); 880 881 } 881 if (!SetPriorityClass (GetCurrentProcess (), dw Priority))882 if (!SetPriorityClass (GetCurrentProcess (), dwClass)) 882 883 fprintf (stderr, "warning: SetPriorityClass (,%#x) failed with last error %d\n", 884 dwClass, GetLastError ()); 885 if (dwPriority != 0xffffffff 886 && !SetThreadPriority (GetCurrentThread (), dwPriority)) 887 fprintf (stderr, "warning: SetThreadPriority (,%#x) failed with last error %d\n", 883 888 dwPriority, GetLastError ()); 884 889
Note:
See TracChangeset
for help on using the changeset viewer.