Lines Matching refs:twp

68 static void add_taskwatch_locked(task_t task, task_watch_t * twp);
69 static void remove_taskwatch_locked(task_t task, task_watch_t * twp);
1889 add_taskwatch_locked(task_t task, task_watch_t * twp)
1891 queue_enter(&task->task_watchers, twp, task_watch_t *, tw_links);
1897 remove_taskwatch_locked(task_t task, task_watch_t * twp)
1899 queue_remove(&task->task_watchers, twp, task_watch_t *, tw_links);
1910 task_watch_t *twp = NULL;
1941 twp = (task_watch_t *)kalloc(sizeof(task_watch_t));
1942 if (twp == NULL) {
1948 bzero(twp, sizeof(task_watch_t));
1956 kfree(twp, sizeof(task_watch_t));
1963 twp->tw_task = target_task; /* holds the task reference */
1964 twp->tw_thread = target_thread; /* holds the thread reference */
1965 twp->tw_state = target_task->appstate;
1966 twp->tw_importance = target_thread->importance;
1968 add_taskwatch_locked(target_task, twp);
1970 target_thread->taskwatch = twp;
1981 /* retain the thread reference as it is in twp */
1986 if ((twp = target_thread->taskwatch) != NULL) {
1987 task = twp->tw_task;
1989 remove_taskwatch_locked(task, twp);
1993 task_deallocate(task); /* drop task ref in twp */
1994 set_thread_appbg(target_thread, 0, twp->tw_importance);
1995 thread_deallocate(target_thread); /* drop thread ref in twp */
1996 kfree(twp, sizeof(task_watch_t));
2027 task_watch_t * twp;
2057 queue_iterate(&task->task_watchers, twp, task_watch_t *, tw_links) {
2059 threadlist[i].thread = twp->tw_thread;
2062 twp->tw_importance = twp->tw_thread->importance;
2065 threadlist[i].importance = twp->tw_importance;
2088 task_watch_t * twp;
2092 if ((twp = thread->taskwatch) != NULL) {
2094 remove_taskwatch_locked(twp->tw_task, twp);
2097 if (twp != NULL) {
2098 thread_deallocate(twp->tw_thread);
2099 task_deallocate(twp->tw_task);
2100 importance = twp->tw_importance;
2101 kfree(twp, sizeof(task_watch_t));
2112 task_watch_t * twp = NULL;
2138 while((twp = (task_watch_t *)dequeue_head(&task->task_watchers)) != NULL)
2140 twplist[i] = twp;
2147 twp->tw_thread->taskwatch = NULL; /* removed linkage, clear thread holding ref */
2157 twp = twplist[j];
2159 set_thread_appbg(twp->tw_thread, 0, twp->tw_importance);
2160 thread_deallocate(twp->tw_thread);
2161 task_deallocate(twp->tw_task);
2162 kfree(twp, sizeof(task_watch_t));