Changeset 0313ff0 in mainline for kernel/generic/src/proc/thread.c
- Timestamp:
- 2006-12-14T12:35:57Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- def5207
- Parents:
- cd896e2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/proc/thread.c
rcd896e2 r0313ff0 114 114 THREAD->last_cycle = get_cycle(); 115 115 116 /* this is where each thread wakes up after its creation */116 /* This is where each thread wakes up after its creation */ 117 117 spinlock_unlock(&THREAD->lock); 118 118 interrupts_enable(); 119 119 120 120 f(arg); 121 122 /* Accumulate accounting to the task */ 123 ipl_t ipl = interrupts_disable(); 124 125 spinlock_lock(&THREAD->lock); 126 thread_update_accounting(); 127 uint64_t cycles = THREAD->cycles; 128 THREAD->cycles = 0; 129 spinlock_unlock(&THREAD->lock); 130 131 spinlock_lock(&TASK->lock); 132 TASK->cycles += cycles; 133 spinlock_unlock(&TASK->lock); 134 135 interrupts_restore(ipl); 136 121 137 thread_exit(); 122 138 /* not reached */ … … 534 550 spinlock_lock(&threads_lock); 535 551 536 printf("tid name address state task ctx code stack cycles cpu kst wq\n");552 printf("tid name address state task ctx code stack cycles cpu kstack waitqueue\n"); 537 553 printf("------ ---------- ---------- -------- ---------- --- ---------- ---------- ---------- ---- ---------- ----------\n"); 538 554 … … 604 620 * interrupts must be already disabled. 605 621 * 606 * @param t Pointer to thread.607 *608 622 */ 609 623 void thread_update_accounting(void)
Note:
See TracChangeset
for help on using the changeset viewer.