Lines Matching defs:thread
110 #include <kern/thread.h>
193 thread_t thread;
235 /* FIXME: On x86, the thread save state flavor can diverge from the
238 * certain routines may observe the thread as being in an inconsistent
242 queue_iterate(&task->threads, thread, thread_t, task_threads) {
243 machine_thread_switch_addrmode(thread);
506 * (kern/thread.c) about problems with terminating the "current task."
526 thread_t thread, self;
569 * Make sure the current thread does not get aborted out of
577 * each thread independently in thread_terminate_internal -
587 * Terminate each thread in the task.
589 queue_iterate(&task->threads, thread, thread_t, task_threads) {
590 thread_terminate_internal(thread);
625 * If the current thread is a member of the task
627 * the task will not be dropped until the thread
666 * Shut the current task down (except for the current thread) in
670 * all done, let the current thread go.
676 thread_t thread, self;
689 * Task or current thread is already being terminated.
703 * would do this on a thread by thread basis anyway, but this
711 queue_iterate(&task->threads, thread, thread_t, task_threads) {
712 if (thread != self)
713 thread_terminate_internal(thread);
762 register thread_t thread;
772 queue_iterate(&task->threads, thread, thread_t, task_threads) {
773 thread_mtx_lock(thread);
774 thread_hold(thread);
775 thread_mtx_unlock(thread);
823 register thread_t thread, self;
832 * stop. Do not wait for the current thread if it is within
835 queue_iterate(&task->threads, thread, thread_t, task_threads) {
836 if (thread != self)
837 thread_wait(thread);
852 register thread_t thread;
860 queue_iterate(&task->threads, thread, thread_t, task_threads) {
861 thread_mtx_lock(thread);
862 thread_release(thread);
863 thread_mtx_unlock(thread);
904 thread_t thread;
951 for (thread = (thread_t)queue_first(&task->threads); i < actual;
952 ++i, thread = (thread_t)queue_next(&thread->task_threads)) {
953 thread_reference_internal(thread);
954 thread_list[j++] = thread;
957 assert(queue_end(&task->threads, (queue_entry_t)thread));
962 /* can unlock task now that we've got the thread refs */
1269 register thread_t thread;
1282 queue_iterate(&task->threads, thread, thread_t, task_threads) {
1285 thread_read_times(thread, &user_time, &system_time);
1300 register thread_t thread;
1313 queue_iterate(&task->threads, thread, thread_t, task_threads) {
1316 tval = timer_grab(&thread->user_timer);
1320 tval = timer_grab(&thread->system_timer);
1429 register thread_t thread;
1448 queue_iterate(&task->threads, thread, thread_t, task_threads) {
1449 events_info->csw += thread->c_switch;
1477 thread_t thread;
1488 queue_iterate(&task->threads, thread, thread_t, task_threads) {
1489 thread->vtimer_user_save = timer_grab(&thread->user_timer);
1494 queue_iterate(&task->threads, thread, thread_t, task_threads) {
1495 thread->vtimer_prof_save = timer_grab(&thread->user_timer);
1496 thread->vtimer_prof_save += timer_grab(&thread->system_timer);
1501 queue_iterate(&task->threads, thread, thread_t, task_threads) {
1502 thread->vtimer_rlim_save = timer_grab(&thread->user_timer);
1503 thread->vtimer_rlim_save += timer_grab(&thread->system_timer);
1532 thread_t thread = current_thread();
1545 tdelt = timer_delta(&thread->user_timer,
1546 &thread->vtimer_user_save);
1550 tsum = timer_grab(&thread->user_timer);
1551 tsum += timer_grab(&thread->system_timer);
1552 tdelt = tsum - thread->vtimer_prof_save;
1553 thread->vtimer_prof_save = tsum;
1557 tsum = timer_grab(&thread->user_timer);
1558 tsum += timer_grab(&thread->system_timer);
1559 tdelt = tsum - thread->vtimer_rlim_save;
1560 thread->vtimer_rlim_save = tsum;