Changeset 43114c5 in mainline for src/time/clock.c
- Timestamp:
- 2005-04-09T18:22:53Z (20 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8262010
- Parents:
- e6ba9a3f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/time/clock.c
re6ba9a3f r43114c5 58 58 * run all expired timeouts as you visit them. 59 59 */ 60 spinlock_lock(& the->cpu->timeoutlock);61 while ((l = the->cpu->timeout_active_head.next) != &the->cpu->timeout_active_head) {60 spinlock_lock(&CPU->timeoutlock); 61 while ((l = CPU->timeout_active_head.next) != &CPU->timeout_active_head) { 62 62 h = list_get_instance(l, timeout_t, link); 63 63 spinlock_lock(&h->lock); … … 71 71 timeout_reinitialize(h); 72 72 spinlock_unlock(&h->lock); 73 spinlock_unlock(& the->cpu->timeoutlock);73 spinlock_unlock(&CPU->timeoutlock); 74 74 75 75 f(arg); 76 76 77 spinlock_lock(& the->cpu->timeoutlock);77 spinlock_lock(&CPU->timeoutlock); 78 78 } 79 spinlock_unlock(& the->cpu->timeoutlock);79 spinlock_unlock(&CPU->timeoutlock); 80 80 81 81 /* 82 * Do CPU usage accounting and find out whether to preempt the->thread.82 * Do CPU usage accounting and find out whether to preempt THREAD. 83 83 */ 84 84 85 if ( the->thread) {86 spinlock_lock(& the->cpu->lock);87 the->cpu->needs_relink++;88 spinlock_unlock(& the->cpu->lock);85 if (THREAD) { 86 spinlock_lock(&CPU->lock); 87 CPU->needs_relink++; 88 spinlock_unlock(&CPU->lock); 89 89 90 spinlock_lock(& the->thread->lock);91 if (! the->thread->ticks--) {92 spinlock_unlock(& the->thread->lock);90 spinlock_lock(&THREAD->lock); 91 if (!THREAD->ticks--) { 92 spinlock_unlock(&THREAD->lock); 93 93 scheduler(); 94 94 } 95 95 else { 96 spinlock_unlock(& the->thread->lock);96 spinlock_unlock(&THREAD->lock); 97 97 } 98 98 }
Note:
See TracChangeset
for help on using the changeset viewer.