Changeset 4ffa9e0 in mainline for src/proc/thread.c
- Timestamp:
- 2005-02-23T11:48:52Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3418c41
- Parents:
- b109ebb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/proc/thread.c
rb109ebb r4ffa9e0 46 46 #include <time/clock.h> 47 47 #include <list.h> 48 #include <config.h> 49 50 #ifdef __SMP__ 51 #include <arch/interrupt.h> 52 #include <arch/apic.h> 53 #endif /* __SMP__ */ 48 54 49 55 char *thread_states[] = {"Invalid", "Running", "Sleeping", "Ready", "Entering", "Exiting"}; … … 89 95 runq_t *r; 90 96 pri_t pri; 91 int i ;97 int i, avg, send_ipi = 0; 92 98 93 99 pri = cpu_priority_high(); … … 113 119 114 120 spinlock_lock(&nrdylock); 115 nrdy++;121 avg = ++nrdy / config.cpu_active; 116 122 spinlock_unlock(&nrdylock); 117 123 118 124 spinlock_lock(&cpu->lock); 119 cpu->nrdy++; 125 if ((++cpu->nrdy) > avg && (config.cpu_active == config.cpu_count)) { 126 /* 127 * If there are idle halted CPU's, this will wake them up. 128 */ 129 #ifdef __SMP__ 130 l_apic_broadcast_custom_ipi(VECTOR_WAKEUP_IPI); 131 #endif /* __SMP__ */ 132 } 120 133 spinlock_unlock(&cpu->lock); 121 134
Note:
See TracChangeset
for help on using the changeset viewer.