Rev 2446 | Rev 3222 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2446 | Rev 2504 | ||
---|---|---|---|
Line 39... | Line 39... | ||
39 | #include <ipc/ipc.h> |
39 | #include <ipc/ipc.h> |
40 | #include <synch/spinlock.h> |
40 | #include <synch/spinlock.h> |
41 | #include <synch/mutex.h> |
41 | #include <synch/mutex.h> |
42 | #include <synch/rwlock.h> |
42 | #include <synch/rwlock.h> |
43 | #include <synch/futex.h> |
43 | #include <synch/futex.h> |
- | 44 | #include <adt/avl.h> |
|
44 | #include <adt/btree.h> |
45 | #include <adt/btree.h> |
45 | #include <adt/list.h> |
46 | #include <adt/list.h> |
46 | #include <security/cap.h> |
47 | #include <security/cap.h> |
47 | #include <arch/proc/task.h> |
48 | #include <arch/proc/task.h> |
48 | #include <arch/proc/thread.h> |
49 | #include <arch/proc/thread.h> |
Line 54... | Line 55... | ||
54 | 55 | ||
55 | struct thread; |
56 | struct thread; |
56 | 57 | ||
57 | /** Task structure. */ |
58 | /** Task structure. */ |
58 | typedef struct task { |
59 | typedef struct task { |
- | 60 | /** Task's linkage for the tasks_tree AVL tree. */ |
|
- | 61 | avltree_node_t tasks_tree_node; |
|
- | 62 | ||
59 | /** Task lock. |
63 | /** Task lock. |
60 | * |
64 | * |
61 | * Must be acquired before threads_lock and thread lock of any of its |
65 | * Must be acquired before threads_lock and thread lock of any of its |
62 | * threads. |
66 | * threads. |
63 | */ |
67 | */ |
Line 104... | Line 108... | ||
104 | /** Accumulated accounting. */ |
108 | /** Accumulated accounting. */ |
105 | uint64_t cycles; |
109 | uint64_t cycles; |
106 | } task_t; |
110 | } task_t; |
107 | 111 | ||
108 | SPINLOCK_EXTERN(tasks_lock); |
112 | SPINLOCK_EXTERN(tasks_lock); |
109 | extern btree_t tasks_btree; |
113 | extern avltree_t tasks_tree; |
110 | 114 | ||
111 | extern void task_init(void); |
115 | extern void task_init(void); |
112 | extern void task_done(void); |
116 | extern void task_done(void); |
113 | extern task_t *task_create(as_t *as, char *name); |
117 | extern task_t *task_create(as_t *as, char *name); |
114 | extern void task_destroy(task_t *t); |
118 | extern void task_destroy(task_t *t); |