Changeset 530 for trunk/src/gmake/main.c
- Timestamp:
- Sep 17, 2006, 10:38:57 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmake/main.c
r522 r530 282 282 283 283 struct variable shell_var; 284 285 #ifdef KMK 286 /* Process priority. 287 0 = no change; 288 1 = idle / max nice; 289 2 = below normal / nice 10; 290 3 = normal / nice 0; 291 4 = high / nice -10; 292 4 = realtime / nice -19; */ 293 int process_priority = 0; 294 #endif 284 295 285 296 … … 402 413 { 'p', flag, (char *) &print_data_base_flag, 1, 1, 0, 0, 0, 403 414 "print-data-base" }, 415 #ifdef KMK 416 { CHAR_MAX+5, positive_int, (char *) &process_priority, 1, 1, 0, 0, 0, 417 "priority" }, 418 #endif 404 419 { 'q', flag, (char *) &question_flag, 1, 1, 1, 0, 0, "question" }, 405 420 { 'r', flag, (char *) &no_builtin_rules_flag, 1, 1, 0, 0, 0, … … 667 682 } 668 683 } 684 685 686 #ifdef KMK 687 static void 688 set_make_priority (void) 689 { 690 #ifdef WINDOWS32 691 DWORD dwPriority; 692 switch (process_priority) 693 { 694 case 0: return; 695 case 1: dwPriority = IDLE_PRIORITY_CLASS; break; 696 case 2: dwPriority = BELOW_NORMAL_PRIORITY_CLASS; break; 697 case 3: dwPriority = NORMAL_PRIORITY_CLASS; break; 698 case 4: dwPriority = HIGH_PRIORITY_CLASS; break; 699 case 5: dwPriority = REALTIME_PRIORITY_CLASS; break; 700 default: fatal(NILF, _("invalid priority %d\n"), process_priority); 701 } 702 SetPriorityClass(GetCurrentProcess(), dwPriority); 703 #else /*#elif HAVE_NICE */ 704 int nice = 0; 705 switch (process_priority) 706 { 707 case 0: return; 708 case 1: nice = 19; break; 709 case 2: nice = 10; break; 710 case 3: nice = 0; break; 711 case 4: nice = -10; break; 712 case 5: nice = -19; break; 713 default: fatal(NILF, _("invalid priority %d\n"), process_priority); 714 } 715 nice(nice); 716 #endif 717 } 718 #endif 719 669 720 670 721 #ifdef WINDOWS32 … … 1277 1328 1278 1329 decode_debug_flags (); 1330 1331 #ifdef KMK 1332 set_make_priority (); 1333 #endif 1279 1334 1280 1335 /* Set always_make_flag if -B was given and we've not restarted already. */
Note:
See TracChangeset
for help on using the changeset viewer.